2016-03-25 01:18:05 -07:00
|
|
|
<?php
|
2021-06-10 13:15:52 -07:00
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
trait CompanyableTrait
|
|
|
|
{
|
|
|
|
/**
|
2024-04-11 07:15:56 -07:00
|
|
|
* This trait is used to scope models to the current company. To use this scope on companyable models,
|
|
|
|
* we use the "use Companyable;" statement at the top of the mode.
|
2016-03-25 01:18:05 -07:00
|
|
|
*
|
2024-04-11 07:15:56 -07:00
|
|
|
* @see \App\Models\Company\Company::scopeCompanyables()
|
2016-03-25 01:18:05 -07:00
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public static function bootCompanyableTrait()
|
|
|
|
{
|
|
|
|
static::addGlobalScope(new CompanyableScope);
|
|
|
|
}
|
|
|
|
}
|