1 | <?php |
||
8 | class StoreFormRequest extends FormRequest |
||
9 | { |
||
10 | /** |
||
11 | * Determine if the user is authorized to make this request. |
||
12 | * |
||
13 | * @return bool |
||
14 | */ |
||
15 | public function authorize() |
||
19 | |||
20 | /** |
||
21 | * Get the validation rules that apply to the request. |
||
22 | * |
||
23 | * @return array |
||
24 | */ |
||
25 | public function rules() |
||
34 | |||
35 | /** |
||
36 | * Get custom attributes for validator errors. |
||
37 | * |
||
38 | * @return array |
||
39 | */ |
||
40 | public function attributes() |
||
44 | } |
||
45 |
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: