akaunting/app/Traits/Tenants.php
2021-01-28 14:29:43 +03:00

29 lines
472 B
PHP

<?php
namespace App\Traits;
use App\Scopes\Company;
trait Tenants
{
/**
* The "booting" method of the model.
*
* @return void
*/
protected static function bootTenants()
{
static::addGlobalScope(new Company);
}
public function isTenantable()
{
return (isset($this->tenantable) && ($this->tenantable === true));
}
public function isNotTenantable()
{
return !$this->isTenantable();
}
}