Akaunting/app/Traits/Tenants.php

29 lines
472 B
PHP
Raw Normal View History

2020-05-02 11:33:41 +00:00
<?php
namespace App\Traits;
2021-01-28 11:29:43 +00:00
use App\Scopes\Company;
2020-05-02 11:33:41 +00:00
trait Tenants
{
2021-01-28 11:29:43 +00:00
/**
* The "booting" method of the model.
*
* @return void
*/
protected static function bootTenants()
{
static::addGlobalScope(new Company);
}
2020-05-02 11:33:41 +00:00
public function isTenantable()
{
return (isset($this->tenantable) && ($this->tenantable === true));
}
public function isNotTenantable()
{
return !$this->isTenantable();
}
}