Created
May 23, 2025 09:31
-
-
Save cybertiwari/e3923a653a8846cad92a3e107547b0e7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Illuminate\Support\Facades\Validator; | |
$validateUser = Validator::make($request->all(), | |
[ | |
'name' => 'required', | |
'email' => 'required|email|unique:users,email', | |
'password' => 'required' | |
]); | |
if($validateUser->fails()){ | |
return response()->json([ | |
'status' => false, | |
'message' => 'validation error', | |
'errors' => $validateUser->errors() | |
], 401); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment