1 | <?php |
||
16 | class NotificationCategory extends Model |
||
17 | { |
||
18 | /** |
||
19 | * @var string |
||
20 | */ |
||
21 | protected $table = 'notification_categories'; |
||
22 | |||
23 | /** |
||
24 | * @var array |
||
25 | */ |
||
26 | protected $fillable = [ |
||
27 | 'name', |
||
28 | 'text', |
||
29 | ]; |
||
30 | |||
31 | /** |
||
32 | * @var array |
||
33 | */ |
||
34 | protected $appends = [ |
||
35 | 'template_body', |
||
36 | ]; |
||
37 | |||
38 | /** |
||
39 | * @var bool |
||
40 | */ |
||
41 | public $timestamps = false; |
||
42 | |||
43 | public function __construct(array $attributes = []) |
||
56 | |||
57 | /** |
||
58 | * @return \Illuminate\Database\Eloquent\Relations\HasMany |
||
59 | */ |
||
60 | public function notifications() |
||
66 | |||
67 | public function setNameAttribute($value) |
||
75 | |||
76 | /** |
||
77 | * @return \Symfony\Component\Translation\TranslatorInterface|string |
||
78 | */ |
||
79 | public function getTemplateBodyAttribute() |
||
91 | |||
92 | /** |
||
93 | * @param Builder $query |
||
94 | * @param $name |
||
95 | * @return Builder |
||
96 | */ |
||
97 | public function scopeByName(Builder $query, $name) |
||
101 | |||
102 | /** |
||
103 | * @param string|int|\Fenos\Notifynder\Models\NotificationCategory $category |
||
104 | * @return int |
||
105 | */ |
||
106 | public static function getIdByCategory($category) |
||
117 | } |
||
118 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: