Add site() to SiteID trait, so site models can be referenced (eg: in email)

This commit is contained in:
Deon George 2022-05-12 12:45:18 +10:00
parent 2d7437fc0d
commit 69e5a5f12c

View File

@ -7,6 +7,7 @@ namespace App\Traits;
use Illuminate\Support\Arr; use Illuminate\Support\Arr;
use App\Models\Site;
use App\Models\Scopes\SiteScope; use App\Models\Scopes\SiteScope;
trait SiteID trait SiteID
@ -26,4 +27,9 @@ trait SiteID
return parent::save(); return parent::save();
} }
public function site()
{
return $this->belongsTo(Site::class);
}
} }