Support the ongoing development of Laravel.io →
Requests Forms Validation
Last updated 2 years ago.
0

I suppose I should state the error I am getting:

Declaration of App\Http\Requests\ContactFormRequest::response() should be compatible with Illuminate\Foundation\Http\FormRequest::response(array $errors)

Last updated 9 years ago.
0

If you don't need to change the response that the form request gives you you can just remove the forbiddenResponse() and response() methods. If you want to change them the error says you need to add the parameter array $errors to your method declaration. In this parameter you will get the errors that happened during validation.

So you need to change the line

public function response()

to

public function response(array $errors)
Last updated 9 years ago.
0

Ah. Thank You. Removing those overrides did the trick.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

xdega xdega Joined 30 Aug 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.