Mego
1 month ago

403 error after validating form

Posted 1 month ago by Mego

Hello. I have created a form in one of my something.blade.php. The form has no action, this is solved by routes/web.php (Route::get render form and Route::post should process the form).

I have really followed the documentation steps, I have created a new file in App/Requests/ReportBug.php via php artisan command Then I have fullfiled some validation rules. In the controller I wrote a "hint to request", like

public function report(ReportBug $request) // ReportBug is a name of app/requests/file

And then copy/pasty the validation statement from docs

$validated = $request->validated();

Also there is var_dump($validated); after that (cause I would to know what is in $validated variable). When I fill the form on front-end and push the submit button, I received Forbidden, 403 This action is unauthorized.

Why?

Please sign in or create an account to participate in this conversation.