-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Closed
Labels
Description
- Laravel Version: 6.6.0
- PHP Version: 7,2.19
- Database Driver & Version:
Description:
Documentation says I can do something like the following:
email' => 'unique:App\User,email_address'
But I do a simple test and it fails!
Steps To Reproduce:
Test:
/** @test */
public function it_check_unique_validation()
{
$user = factory(User::class)->create();
$validator = Validator::make(['email' => $user->email],[
'email' => 'unique:App\User',
]);
$this->assertTrue($validator->fails());
$this->assertEquals(
'The email has already been taken.',
$validator->errors()->first()
);
}
Result:
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'lara6
.app\user' doesn't exist