| 1 | <?php |
||
| 10 | class CreateRequest extends FormRequest |
||
| 11 | { |
||
| 12 | use SavesDiscussion; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Determine if the user is authorized to make this request. |
||
| 16 | * |
||
| 17 | * @return bool |
||
| 18 | */ |
||
| 19 | public function authorize() |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Get the validation rules that apply to the request. |
||
| 26 | * |
||
| 27 | * @return array |
||
| 28 | */ |
||
| 29 | public function rules() |
||
| 35 | |||
| 36 | public function failedAuthorization() |
||
| 50 | } |
||
| 51 |
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: