Reputation: 217
I'm building a laravel API, and I'm testing my requests from Postman. Simple request taking a too long time to get some response(about 132061 ms) and it returns blank. Anyone have any idea what be happening?
public function register(Request $request)
{
$request->validate([
'name' => 'required|string',
'email' => 'required|string|email|unique:users',
'password' => 'required|string|confirmed'
]);
return response()->json([
'message' => 'Successfully created user!'
], 201);
}
Upvotes: 0
Views: 771
Reputation: 33
You set the password to be confirmed in the rules for validation, but the confirmation field doesn't appear in your request. Try again after you removed the 'confirmed' rule from the rules or add 'password_confirmation' with same value as password field to your request
Upvotes: 1