1 | <?php |
||||
2 | |||||
3 | namespace Fomvasss\UrlAliases\Traits; |
||||
4 | |||||
5 | trait UrlAliasable |
||||
6 | { |
||||
7 | use LocaleScopes; |
||||
8 | |||||
9 | /** |
||||
10 | * @return mixed |
||||
11 | */ |
||||
12 | public function urlAlias() |
||||
13 | { |
||||
14 | $model = config('url-aliases.model', \Fomvasss\UrlAliases\Models\UrlAlias::class); |
||||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||||
15 | |||||
16 | return $this->morphOne($model, 'model'); |
||||
0 ignored issues
–
show
It seems like
morphOne() must be provided by classes using this trait. How about adding it as abstract method to this trait?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
17 | } |
||||
18 | |||||
19 | /** |
||||
20 | * @return mixed |
||||
21 | */ |
||||
22 | public function urlAliases() |
||||
23 | { |
||||
24 | $model = config('url-aliases.model', \Fomvasss\UrlAliases\Models\UrlAlias::class); |
||||
0 ignored issues
–
show
The function
config was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
25 | |||||
26 | return $this->morphMany($model, 'model'); |
||||
0 ignored issues
–
show
It seems like
morphMany() must be provided by classes using this trait. How about adding it as abstract method to this trait?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
27 | } |
||||
28 | |||||
29 | /** |
||||
30 | * @return |null |
||||
0 ignored issues
–
show
|
|||||
31 | */ |
||||
32 | public function getLocaleboundStr() |
||||
33 | { |
||||
34 | if ($this->urlAlias) { |
||||
35 | return $this->urlAlias->locale_bound; |
||||
36 | } |
||||
37 | |||||
38 | return null; |
||||
39 | } |
||||
40 | } |