1 | <?php |
||
11 | class User extends Model implements Authenticatable |
||
12 | { |
||
13 | use Notifiable; |
||
14 | |||
15 | protected $table = 'users'; |
||
16 | protected $guarded = []; |
||
17 | |||
18 | /** |
||
19 | * The event map for the model. |
||
20 | * |
||
21 | * @var array |
||
22 | */ |
||
23 | protected $dispatchesEvents = [ |
||
24 | 'saved' => UserEvent::class, |
||
25 | ]; |
||
26 | |||
27 | /** |
||
28 | * The attributes that are mass assignable. |
||
29 | * |
||
30 | * @var array |
||
31 | */ |
||
32 | protected $fillable = [ |
||
33 | 'username', 'mail', 'password', 'account_created', 'ip_register', 'ip_current', 'last_login', |
||
34 | ]; |
||
35 | |||
36 | /** |
||
37 | * The attributes that should be hidden for arrays. |
||
38 | * |
||
39 | * @var array |
||
40 | */ |
||
41 | protected $hidden = [ |
||
42 | 'password', 'remember_token', |
||
43 | ]; |
||
44 | |||
45 | /** |
||
46 | * The attributes that should be cast to native types. |
||
47 | * |
||
48 | * @var array |
||
49 | */ |
||
50 | protected $casts = [ |
||
51 | 'email_verified_at' => 'datetime', |
||
52 | ]; |
||
53 | |||
54 | public function getEmailAttribute() |
||
58 | |||
59 | public function getEmailForPasswordReset() |
||
63 | |||
64 | public function getEmailForVerification() |
||
68 | |||
69 | /** |
||
70 | * Get the permissions for an avatar. |
||
71 | */ |
||
72 | public function permissions() |
||
76 | |||
77 | /* |
||
78 | * Get avatar settings |
||
79 | */ |
||
80 | public function settings() |
||
84 | |||
85 | /* |
||
86 | * Get the bans for an avatar |
||
87 | */ |
||
88 | public function bans() |
||
92 | |||
93 | /** |
||
94 | * Get friend requests. |
||
95 | */ |
||
96 | public function friend_requests() |
||
100 | |||
101 | /** |
||
102 | * Get friends. |
||
103 | */ |
||
104 | public function friends() |
||
108 | |||
109 | public function getLastLoginAttribute() |
||
113 | |||
114 | /** |
||
115 | * Get the name of the unique identifier for the user. |
||
116 | * |
||
117 | * @return string |
||
118 | */ |
||
119 | public function getAuthIdentifierName() |
||
123 | |||
124 | /** |
||
125 | * Get the unique identifier for the user. |
||
126 | * |
||
127 | * @return mixed |
||
128 | */ |
||
129 | public function getAuthIdentifier() |
||
133 | |||
134 | /** |
||
135 | * Get the password for the user. |
||
136 | * |
||
137 | * @return string |
||
138 | */ |
||
139 | public function getAuthPassword() |
||
143 | |||
144 | /** |
||
145 | * Get the token value for the "remember me" session. |
||
146 | * |
||
147 | * @return string |
||
148 | */ |
||
149 | public function getRememberToken() |
||
153 | |||
154 | /** |
||
155 | * Set the token value for the "remember me" session. |
||
156 | * |
||
157 | * @param string $value |
||
158 | * @return void |
||
159 | */ |
||
160 | public function setRememberToken($value) |
||
164 | |||
165 | /** |
||
166 | * Get the column name for the "remember me" token. |
||
167 | * |
||
168 | * @return string |
||
169 | */ |
||
170 | public function getRememberTokenName() |
||
174 | |||
175 | /* |
||
176 | * Custom methods |
||
177 | */ |
||
178 | public static function randomNickname() |
||
186 | } |
||
187 |
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: