Create a new request by running
php artisan make:request SomeRequest
Change SomeRequest with a suitable name. Now you will be having a file named SomeRequest under app/Http/Requests folder by the name of SomeRequest.php
declare your valadations in this file and then in your function use it like
public function somefunction(Requests\SomeRequest $request) { //your process will come here only if all the validations passes }
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community