1 | <?php |
||
24 | class Article extends Model |
||
25 | { |
||
26 | /** |
||
27 | * Published date and time field name. |
||
28 | */ |
||
29 | private const PUBLISHED_AT = 'published_at'; |
||
30 | |||
31 | /** |
||
32 | * Directory of article images. |
||
33 | */ |
||
34 | public const DEFAULT_IMAGE_PATH = '/static/articles/'; |
||
35 | |||
36 | /** |
||
37 | * @var array |
||
38 | */ |
||
39 | protected $dates = [ |
||
40 | self::PUBLISHED_AT, |
||
41 | ]; |
||
42 | |||
43 | /** |
||
44 | * @var string |
||
45 | */ |
||
46 | protected $table = 'articles'; |
||
47 | |||
48 | /** |
||
49 | * @var array |
||
50 | */ |
||
51 | protected $fillable = [ |
||
52 | 'user_id', 'title', 'image', 'content_source', |
||
53 | 'status', 'published_at', |
||
54 | ]; |
||
55 | |||
56 | /** |
||
57 | * @param Builder $builder |
||
58 | * @return Builder |
||
59 | */ |
||
60 | public static function scopeLatestPublished(Builder $builder): Builder |
||
68 | |||
69 | /** |
||
70 | * @param Builder $builder |
||
71 | * @return Builder |
||
72 | */ |
||
73 | public static function scopeLatest(Builder $builder): Builder |
||
77 | |||
78 | /** |
||
79 | * @param Builder $builder |
||
80 | * @return Builder |
||
81 | */ |
||
82 | public static function scopePublished(Builder $builder): Builder |
||
88 | |||
89 | /** |
||
90 | * @param Builder $builder |
||
91 | * @return Builder |
||
92 | */ |
||
93 | public static function scopePublishedByBot(Builder $builder): Builder |
||
98 | |||
99 | /** |
||
100 | * @param Authenticatable|User|null $user |
||
101 | * @return bool |
||
102 | */ |
||
103 | public function isAllowedForUser(?Authenticatable $user): bool |
||
113 | |||
114 | /** |
||
115 | * @return string |
||
116 | */ |
||
117 | public function getImageUrlAttribute(): string |
||
125 | |||
126 | /** |
||
127 | * @return string |
||
128 | */ |
||
129 | public function getCapitalizeTitleAttribute(): string |
||
133 | |||
134 | /** |
||
135 | * @return string |
||
136 | */ |
||
137 | public function getNicePublishedDateAttribute(): string |
||
145 | |||
146 | /** |
||
147 | * @return MorphTo |
||
148 | */ |
||
149 | public function user(): MorphTo |
||
153 | |||
154 | /** |
||
155 | * @return BelongsToMany |
||
156 | */ |
||
157 | public function tags(): BelongsToMany |
||
161 | } |
||
162 |
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.