Support the ongoing development of →
Laravel Requests Validation
Last updated 1 year ago.

The request validate function directly validate the input. If it fails it will throw an exception that is by default handled. (You can catch it and do your own validation)

The return value of the validate function is the data


public function registerPost(Request $request)
        $validData = $request->validate([
            'rname' => 'required|min:3|max:20|alphaspace',
            'rlastname' => 'required|min:3|max:30|alphaspace',
            'remail' => 'required|email|unique:users,email',
            'password' => 'required|min:8|confirmed',
            'password_confirmation' => 'required',

        //here can you do something with the validData

Sign in to participate in this thread!

Full Stack Europe

Your banner here too?


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

Your logo here?

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

© 2023 - All rights reserved.