1 | <?php |
||
25 | class Article extends Model |
||
26 | { |
||
27 | /** |
||
28 | * Published date and time field name. |
||
29 | */ |
||
30 | private const PUBLISHED_AT = 'published_at'; |
||
31 | |||
32 | /** |
||
33 | * Directory of article images. |
||
34 | */ |
||
35 | public const DEFAULT_IMAGE_PATH = '/static/articles/'; |
||
36 | |||
37 | /** |
||
38 | * @var array |
||
39 | */ |
||
40 | protected $dates = [ |
||
41 | self::PUBLISHED_AT, |
||
42 | ]; |
||
43 | |||
44 | /** |
||
45 | * @var string |
||
46 | */ |
||
47 | protected $table = 'articles'; |
||
48 | |||
49 | /** |
||
50 | * @var array |
||
51 | */ |
||
52 | protected $fillable = [ |
||
53 | 'user_id', 'title', 'image', 'content_source', |
||
54 | 'status', 'published_at', |
||
55 | ]; |
||
56 | |||
57 | /** |
||
58 | * @param Builder $builder |
||
59 | * @return Builder |
||
60 | */ |
||
61 | public static function scopeLatestPublished(Builder $builder): Builder |
||
69 | |||
70 | /** |
||
71 | * @param Builder $builder |
||
72 | * @return Builder |
||
73 | */ |
||
74 | public static function scopeLatest(Builder $builder): Builder |
||
78 | |||
79 | /** |
||
80 | * @param Builder $builder |
||
81 | * @return Builder |
||
82 | */ |
||
83 | public static function scopePublished(Builder $builder): Builder |
||
89 | |||
90 | /** |
||
91 | * @param Builder $builder |
||
92 | * @return Builder |
||
93 | */ |
||
94 | public static function scopePublishedByBot(Builder $builder): Builder |
||
99 | |||
100 | /** |
||
101 | * @param Authenticatable|User|null $user |
||
102 | * @return bool |
||
103 | */ |
||
104 | public function isAllowedForUser(?Authenticatable $user): bool |
||
114 | |||
115 | /** |
||
116 | * @return string |
||
117 | */ |
||
118 | public function getImageUrlAttribute(): string |
||
126 | |||
127 | /** |
||
128 | * @return string |
||
129 | */ |
||
130 | public function getCapitalizeTitleAttribute(): string |
||
134 | |||
135 | /** |
||
136 | * @return string |
||
137 | */ |
||
138 | public function getNicePublishedDateAttribute(): string |
||
146 | |||
147 | /** |
||
148 | * @return MorphTo |
||
149 | */ |
||
150 | public function user(): MorphTo |
||
154 | |||
155 | /** |
||
156 | * @return BelongsToMany |
||
157 | */ |
||
158 | public function tags(): BelongsToMany |
||
162 | } |
||
163 |
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.