Skip to content

Instantly share code, notes, and snippets.

@patrickcurl
Created August 11, 2021 23:38
Show Gist options
  • Save patrickcurl/869ddbdb7f04649604a3ac41a2a0f52b to your computer and use it in GitHub Desktop.
Save patrickcurl/869ddbdb7f04649604a3ac41a2a0f52b to your computer and use it in GitHub Desktop.
Laravel Breeze Tutorial LoginRequest.php -- rules
<?php
// ...
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'email' =>
'required_without:username|string|email|exists:users,email',
'username' =>
'required_without:email|string|exists:users,username',
'password' => 'required|string',
];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment