added tenantable attribute to models
This commit is contained in:
@ -3,10 +3,13 @@
|
||||
namespace App\Models\Setting;
|
||||
|
||||
use App\Scopes\Company;
|
||||
use App\Traits\Tenants;
|
||||
use Illuminate\Database\Eloquent\Model as Eloquent;
|
||||
|
||||
class Setting extends Eloquent
|
||||
{
|
||||
use Tenants;
|
||||
|
||||
protected $table = 'settings';
|
||||
|
||||
public $timestamps = false;
|
||||
@ -55,4 +58,14 @@ class Setting extends Eloquent
|
||||
{
|
||||
return $query->where($this->table . '.company_id', '=', $company_id);
|
||||
}
|
||||
|
||||
public function isTenantable()
|
||||
{
|
||||
return (isset($this->tenantable) && ($this->tenantable === true));
|
||||
}
|
||||
|
||||
public function isNotTenantable()
|
||||
{
|
||||
return !$this->isTenantable();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user