Did you start a new app with Breeze?
https://laravel.com/docs/8.x/starter-kits#laravel-breeze-installation
The docs state:
Installation
First, you should create a new Laravel application, configure your database, and run your database migrations:
I've just recently added Laravel Breeze to my application and running my test suite the tests that Breeze comes with out of the box and trying to debug to find out why this test fails for me. Inside the dd($response) I am seeing a failed email field validation error. Prior to installing breeze I had views already set up so I don't know if there is something that comes with Breeze that I removed that is needed to make these tests pass.
public function test_users_can_authenticate_using_the_login_screen()
{
$user = User::factory()->create();
$response = $this->post('/login', [
'email' => $user->email,
'password' => 'password',
]);
dd($response);
$this->assertAuthenticated();
$response->assertRedirect(RouteServiceProvider::HOME);
}
The stacktrace shows that the a Validation exception is being thrown inside of the LoginRequest class provided by Breeze and inside of the authenticate method. As you can see I have not made any changes to that method and I have not made any other changes to that file.
if (! Auth::attempt($this->only('email', 'password'), $this->boolean('remember'))) {
RateLimiter::hit($this->throttleKey());
throw ValidationException::withMessages([
'email' => __('auth.failed'),
]);
}
If I dd($this->only('email', 'password'), $this->boolean('remember')); then I get the following response.
array:2 [
"email" => "[email protected]"
"password" => "password"
]
false
Please or to participate in this conversation.