EscolaLMS/Auth

View on GitHub
src/Models/Traits/HasOnboardingStatus.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace EscolaLms\Auth\Models\Traits;

/**
 * Trait HasOnboardinngStatus
 * @package EscolaLms\Auth\Models\Traits
 *
 * TODO:
 * This trait for now only checks if user has any interest (categories) added
 * In future we should use specification pattern allowing to create any number of rules by injecting
 */
trait HasOnboardingStatus
{
    use ExtendableModelTrait;

    public function getOnboardingCompletedAttribute()
    {
        return count($this->getTraitOwner()->interests);
    }
}