| Total Complexity | 9 |
| Total Lines | 70 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class Announcement extends Model |
||
| 11 | { |
||
| 12 | use LogsActivity; |
||
| 13 | |||
| 14 | protected $guarded = []; |
||
| 15 | |||
| 16 | // Forget cache on updating or saving and deleting |
||
| 17 | public static function boot() |
||
| 27 | }); |
||
| 28 | } |
||
| 29 | |||
| 30 | // Cache Keys |
||
| 31 | private static function cacheKey() |
||
| 32 | { |
||
| 33 | Cache::has('announcements') ? Cache::forget('announcements') : ''; |
||
| 34 | } |
||
| 35 | |||
| 36 | // Logs |
||
| 37 | protected static $logName = 'announcement'; |
||
| 38 | |||
| 39 | // Appends |
||
| 40 | protected $appends = ['audience_names', 'color']; |
||
| 41 | |||
| 42 | // Casts |
||
| 43 | protected $casts = [ |
||
| 44 | 'medium' => 'array', |
||
| 45 | 'audience' => 'array', |
||
| 46 | ]; |
||
| 47 | |||
| 48 | // Relation |
||
| 49 | public function user() |
||
| 50 | { |
||
| 51 | return $this->belongsTo(User::class, 'user_id'); |
||
| 52 | } |
||
| 53 | |||
| 54 | // Accessors |
||
| 55 | public function getAudienceNamesAttribute() |
||
| 56 | { |
||
| 57 | return User::find($this->audience)->pluck('name')->toArray(); |
||
| 58 | } |
||
| 59 | |||
| 60 | public function getColorAttribute() |
||
| 65 | } |
||
| 66 | |||
| 67 | public function mediums() |
||
| 68 | { |
||
| 83 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths