| Total Complexity | 6 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | class Permission extends Model |
||
| 11 | { |
||
| 12 | use LogsActivity; |
||
|
|
|||
| 13 | |||
| 14 | protected $guarded = []; |
||
| 15 | |||
| 16 | // Mutators |
||
| 17 | public function setCanAttribute($value) |
||
| 20 | } |
||
| 21 | |||
| 22 | // Forget cache on updating or saving and deleting |
||
| 23 | public static function boot() |
||
| 24 | { |
||
| 25 | parent::boot(); |
||
| 26 | |||
| 27 | static::saving(function () { |
||
| 28 | self::cacheKey(); |
||
| 29 | }); |
||
| 30 | |||
| 31 | static::deleting(function () { |
||
| 32 | self::cacheKey(); |
||
| 33 | }); |
||
| 34 | } |
||
| 35 | |||
| 36 | // Cache Keys |
||
| 37 | private static function cacheKey() |
||
| 40 | } |
||
| 41 | |||
| 42 | // Logs |
||
| 43 | protected static $logName = 'permission'; |
||
| 44 | |||
| 45 | public function getActivitylogOptions(): LogOptions |
||
| 46 | { |
||
| 47 | return LogOptions::defaults(); |
||
| 48 | } |
||
| 49 | |||
| 50 | // Relations |
||
| 51 | public function role() |
||
| 54 | } |
||
| 55 | } |
||
| 56 |