1 | <?php |
||
2 | |||
3 | namespace Innoflash\Events\Models; |
||
4 | |||
5 | use FaithGen\SDK\Models\UuidModel; |
||
6 | use FaithGen\SDK\SDK; |
||
0 ignored issues
–
show
|
|||
7 | use FaithGen\SDK\Traits\Relationships\Belongs\BelongsToMinistryTrait; |
||
8 | use FaithGen\SDK\Traits\Relationships\Morphs\CommentableTrait; |
||
9 | use FaithGen\SDK\Traits\Relationships\Morphs\ImageableTrait; |
||
10 | use FaithGen\SDK\Traits\StorageTrait; |
||
11 | |||
12 | class Event extends UuidModel |
||
13 | { |
||
14 | use BelongsToMinistryTrait, CommentableTrait, ImageableTrait, StorageTrait; |
||
15 | |||
16 | protected $table = 'fg_events'; |
||
17 | protected $casts = [ |
||
18 | 'location' => 'array', |
||
19 | ]; |
||
20 | |||
21 | protected $hidden = [ |
||
22 | 'ministry_id', |
||
23 | 'created_at', |
||
24 | 'updated_at', |
||
25 | ]; |
||
26 | |||
27 | public function guests() |
||
28 | { |
||
29 | return $this->hasMany(Guest::class); |
||
30 | } |
||
31 | |||
32 | public function getNameAttribute($val) |
||
33 | { |
||
34 | return ucwords($val); |
||
35 | } |
||
36 | |||
37 | public function getDescriptionAttribute($val) |
||
38 | { |
||
39 | return ucfirst($val); |
||
40 | } |
||
41 | |||
42 | public function scopePublished($query) |
||
43 | { |
||
44 | if (! config('faithgen-sdk.source')) { |
||
45 | return $query->wherePublished(true); |
||
46 | } else { |
||
47 | return $query; |
||
48 | } |
||
49 | } |
||
50 | |||
51 | public function getPublishedAttribute($val) |
||
52 | { |
||
53 | return (bool) $val; |
||
54 | } |
||
55 | |||
56 | public function filesDir() |
||
57 | { |
||
58 | return 'events'; |
||
59 | } |
||
60 | |||
61 | public function getFileName() |
||
62 | { |
||
63 | return $this->image->name; |
||
0 ignored issues
–
show
|
|||
64 | } |
||
65 | |||
66 | public function getImageDimensions() |
||
67 | { |
||
68 | return [0, 50]; |
||
69 | } |
||
70 | |||
71 | public function getAvatarAttribute() |
||
72 | { |
||
73 | if (! $this->image()->exists()) { |
||
74 | return; |
||
75 | } else { |
||
76 | return [ |
||
77 | '_50' => SDK::getAsset('storage/events/50-50/'.$this->image->name), |
||
0 ignored issues
–
show
|
|||
78 | 'original' => SDK::getAsset('storage/events/original/'.$this->image->name), |
||
79 | ]; |
||
80 | } |
||
81 | } |
||
82 | } |
||
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