ok

Mini Shell

Direktori : /home2/selectio/public_html/fms-worksuite/app/Traits/
Upload File :
Current File : /home2/selectio/public_html/fms-worksuite/app/Traits/HasCompany.php

<?php

namespace App\Traits;

use App\Models\Company;
use App\Scopes\CompanyScope;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

trait HasCompany
{

    protected static function booted()
    {
        static::addGlobalScope(new CompanyScope());
    }

    public function company(): BelongsTo
    {
        return $this->belongsTo(Company::class);
    }

}

Zerion Mini Shell 1.0