1 | <?php |
||
12 | class Url extends Model implements UrlModelContract |
||
13 | { |
||
14 | /** |
||
15 | * The database table. |
||
16 | * |
||
17 | * @var string |
||
18 | */ |
||
19 | protected $table = 'urls'; |
||
20 | |||
21 | /** |
||
22 | * The attributes that are mass assignable. |
||
23 | * |
||
24 | * @var array |
||
25 | */ |
||
26 | protected $fillable = [ |
||
27 | 'url', |
||
28 | 'urlable_id', |
||
29 | 'urlable_type', |
||
30 | ]; |
||
31 | |||
32 | /** |
||
33 | * Get all of the owning urlable models. |
||
34 | * |
||
35 | * @return MorphTo |
||
36 | */ |
||
37 | public function urlable() : MorphTo |
||
41 | |||
42 | /** |
||
43 | * Filter the query by url. |
||
44 | * |
||
45 | * @param Builder $query |
||
46 | * @param string $url |
||
47 | */ |
||
48 | public function scopeWhereUrl(Builder $query, string $url) |
||
52 | |||
53 | /** |
||
54 | * Filter the query by the urlable morph relation. |
||
55 | * |
||
56 | * @param Builder $query |
||
57 | * @param int $id |
||
58 | * @param string $type |
||
59 | */ |
||
60 | public function scopeWhereUrlable(Builder $query, int $id, string $type) |
||
67 | |||
68 | /** |
||
69 | * Sort the query alphabetically by url. |
||
70 | * |
||
71 | * @param Builder $query |
||
72 | */ |
||
73 | public function scopeInAlphabeticalOrder(Builder $query) |
||
77 | |||
78 | /** |
||
79 | * Get the model instance correlated with the accessed url. |
||
80 | * |
||
81 | * @param bool $silent |
||
82 | * @return Model|null |
||
83 | * @throws ModelNotFoundException |
||
84 | */ |
||
85 | public static function getUrlable(bool $silent = true): ?Model |
||
97 | |||
98 | /** |
||
99 | * Get the model instance correlated with the accessed url. |
||
100 | * Throw a ModelNotFoundException if the model doesn't exist. |
||
101 | * |
||
102 | * @return Model|null |
||
103 | * @throws ModelNotFoundException |
||
104 | */ |
||
105 | public static function getUrlableOrFail(): ?Model |
||
109 | } |
||
110 |
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.