| 1 | <?php |
||
| 7 | abstract class BaseFeature extends Model |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * The attributes that are mass assignable. |
||
| 11 | * |
||
| 12 | * @var array |
||
| 13 | */ |
||
| 14 | protected $fillable = [ |
||
| 15 | 'name', 'model', 'label', 'description', 'auto_add' |
||
| 16 | ]; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * The features relationship |
||
| 20 | */ |
||
| 21 | public function tenants() |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Give this feature to the provided tenant |
||
| 28 | * |
||
| 29 | * @param BaseTenant $tenant |
||
| 30 | * |
||
| 31 | * @return void |
||
| 32 | */ |
||
| 33 | public function giveToTenant(BaseTenant $tenant) |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Confirm if a feature is activated for a given tenant |
||
| 42 | * |
||
| 43 | * @param BaseTenant $tenant |
||
| 44 | * |
||
| 45 | * @return boolean |
||
| 46 | */ |
||
| 47 | public function hasTenant(BaseTenant $tenant) |
||
| 51 | } |
||
| 52 |