diff --git a/app/Http/Controllers/Auth/ConfirmablePasswordController.php b/app/Http/Controllers/Auth/ConfirmablePasswordController.php index 712394a..75399ab 100644 --- a/app/Http/Controllers/Auth/ConfirmablePasswordController.php +++ b/app/Http/Controllers/Auth/ConfirmablePasswordController.php @@ -24,10 +24,12 @@ class ConfirmablePasswordController extends Controller */ public function store(Request $request): RedirectResponse { - if (! Auth::guard('web')->validate([ + if ( + ! Auth::guard('web')->validate([ 'email' => $request->user()->email, 'password' => $request->password, - ])) { + ]) + ) { throw ValidationException::withMessages([ 'password' => __('auth.password'), ]); diff --git a/app/Http/Controllers/Auth/RegisteredUserController.php b/app/Http/Controllers/Auth/RegisteredUserController.php index 0739e2e..88dbc08 100644 --- a/app/Http/Controllers/Auth/RegisteredUserController.php +++ b/app/Http/Controllers/Auth/RegisteredUserController.php @@ -31,7 +31,7 @@ class RegisteredUserController extends Controller { $request->validate([ 'name' => ['required', 'string', 'max:255'], - 'email' => ['required', 'string', 'lowercase', 'email', 'max:255', 'unique:'.User::class], + 'email' => ['required', 'string', 'lowercase', 'email', 'max:255', 'unique:' . User::class], 'password' => ['required', 'confirmed', Rules\Password::defaults()], ]); diff --git a/app/Http/Controllers/Auth/VerifyEmailController.php b/app/Http/Controllers/Auth/VerifyEmailController.php index 784765e..aed2efd 100644 --- a/app/Http/Controllers/Auth/VerifyEmailController.php +++ b/app/Http/Controllers/Auth/VerifyEmailController.php @@ -15,13 +15,13 @@ class VerifyEmailController extends Controller public function __invoke(EmailVerificationRequest $request): RedirectResponse { if ($request->user()->hasVerifiedEmail()) { - return redirect()->intended(route('dashboard', absolute: false).'?verified=1'); + return redirect()->intended(route('dashboard', absolute: false) . '?verified=1'); } if ($request->user()->markEmailAsVerified()) { event(new Verified($request->user())); } - return redirect()->intended(route('dashboard', absolute: false).'?verified=1'); + return redirect()->intended(route('dashboard', absolute: false) . '?verified=1'); } } diff --git a/app/Http/Requests/Auth/LoginRequest.php b/app/Http/Requests/Auth/LoginRequest.php index 2b92f65..c1b3a3e 100644 --- a/app/Http/Requests/Auth/LoginRequest.php +++ b/app/Http/Requests/Auth/LoginRequest.php @@ -80,6 +80,6 @@ class LoginRequest extends FormRequest */ public function throttleKey(): string { - return Str::transliterate(Str::lower($this->string('email')).'|'.$this->ip()); + return Str::transliterate(Str::lower($this->string('email')) . '|' . $this->ip()); } } diff --git a/app/Http/Requests/ProfileUpdateRequest.php b/app/Http/Requests/ProfileUpdateRequest.php index 93b0022..0ec25eb 100644 --- a/app/Http/Requests/ProfileUpdateRequest.php +++ b/app/Http/Requests/ProfileUpdateRequest.php @@ -17,7 +17,14 @@ class ProfileUpdateRequest extends FormRequest { return [ 'name' => ['required', 'string', 'max:255'], - 'email' => ['required', 'string', 'lowercase', 'email', 'max:255', Rule::unique(User::class)->ignore($this->user()->id)], + 'email' => [ + 'required', + 'string', + 'lowercase', + 'email', + 'max:255', + Rule::unique(User::class)->ignore($this->user()->id) + ], ]; } } diff --git a/routes/web.php b/routes/web.php index f73fd30..de87b81 100644 --- a/routes/web.php +++ b/routes/web.php @@ -27,4 +27,4 @@ Route::middleware(['auth', 'verified'])->prefix('admin')->group(function () { '/task_statuses' => TaskStatusesController::class, ]); }); -require __DIR__.'/auth.php'; +require __DIR__ . '/auth.php'; diff --git a/tests/Feature/Auth/AuthenticationTest.php b/tests/Feature/Auth/AuthenticationTest.php index 13dcb7c..253f02f 100644 --- a/tests/Feature/Auth/AuthenticationTest.php +++ b/tests/Feature/Auth/AuthenticationTest.php @@ -10,14 +10,14 @@ class AuthenticationTest extends TestCase { use RefreshDatabase; - public function test_login_screen_can_be_rendered(): void + public function testLoginScreenCanBeRendered(): void { $response = $this->get('/login'); $response->assertStatus(200); } - public function test_users_can_authenticate_using_the_login_screen(): void + public function testUsersCanAuthenticateUsingTheLoginScreen(): void { $user = User::factory()->create(); @@ -30,7 +30,7 @@ class AuthenticationTest extends TestCase $response->assertRedirect(route('dashboard', absolute: false)); } - public function test_users_can_not_authenticate_with_invalid_password(): void + public function testUsersCanNotAuthenticateWithInvalidPassword(): void { $user = User::factory()->create(); @@ -42,7 +42,7 @@ class AuthenticationTest extends TestCase $this->assertGuest(); } - public function test_users_can_logout(): void + public function testUsersCanLogout(): void { $user = User::factory()->create(); diff --git a/tests/Feature/Auth/EmailVerificationTest.php b/tests/Feature/Auth/EmailVerificationTest.php index 705570b..f8ae874 100644 --- a/tests/Feature/Auth/EmailVerificationTest.php +++ b/tests/Feature/Auth/EmailVerificationTest.php @@ -13,7 +13,7 @@ class EmailVerificationTest extends TestCase { use RefreshDatabase; - public function test_email_verification_screen_can_be_rendered(): void + public function testEmailVerificationScreenCanBeRendered(): void { $user = User::factory()->unverified()->create(); @@ -22,7 +22,7 @@ class EmailVerificationTest extends TestCase $response->assertStatus(200); } - public function test_email_can_be_verified(): void + public function testEmailCanBeVerified(): void { $user = User::factory()->unverified()->create(); @@ -38,10 +38,10 @@ class EmailVerificationTest extends TestCase Event::assertDispatched(Verified::class); $this->assertTrue($user->fresh()->hasVerifiedEmail()); - $response->assertRedirect(route('dashboard', absolute: false).'?verified=1'); + $response->assertRedirect(route('dashboard', absolute: false) . '?verified=1'); } - public function test_email_is_not_verified_with_invalid_hash(): void + public function testEmailIsNotVerifiedWithInvalidHash(): void { $user = User::factory()->unverified()->create(); diff --git a/tests/Feature/Auth/PasswordConfirmationTest.php b/tests/Feature/Auth/PasswordConfirmationTest.php index ff85721..322c2cc 100644 --- a/tests/Feature/Auth/PasswordConfirmationTest.php +++ b/tests/Feature/Auth/PasswordConfirmationTest.php @@ -10,7 +10,7 @@ class PasswordConfirmationTest extends TestCase { use RefreshDatabase; - public function test_confirm_password_screen_can_be_rendered(): void + public function testConfirmPasswordScreenCanBeRendered(): void { $user = User::factory()->create(); @@ -19,7 +19,7 @@ class PasswordConfirmationTest extends TestCase $response->assertStatus(200); } - public function test_password_can_be_confirmed(): void + public function testPasswordCanBeConfirmed(): void { $user = User::factory()->create(); @@ -31,7 +31,7 @@ class PasswordConfirmationTest extends TestCase $response->assertSessionHasNoErrors(); } - public function test_password_is_not_confirmed_with_invalid_password(): void + public function testPasswordIsNotConfirmedWithInvalidPassword(): void { $user = User::factory()->create(); diff --git a/tests/Feature/Auth/PasswordResetTest.php b/tests/Feature/Auth/PasswordResetTest.php index aa50350..5c3f0f1 100644 --- a/tests/Feature/Auth/PasswordResetTest.php +++ b/tests/Feature/Auth/PasswordResetTest.php @@ -12,14 +12,14 @@ class PasswordResetTest extends TestCase { use RefreshDatabase; - public function test_reset_password_link_screen_can_be_rendered(): void + public function testResetPasswordLinkScreenCanBeRendered(): void { $response = $this->get('/forgot-password'); $response->assertStatus(200); } - public function test_reset_password_link_can_be_requested(): void + public function testResetPasswordLinkCanBeRequested(): void { Notification::fake(); @@ -30,7 +30,7 @@ class PasswordResetTest extends TestCase Notification::assertSentTo($user, ResetPassword::class); } - public function test_reset_password_screen_can_be_rendered(): void + public function testResetPasswordScreenCanBeRendered(): void { Notification::fake(); @@ -39,7 +39,7 @@ class PasswordResetTest extends TestCase $this->post('/forgot-password', ['email' => $user->email]); Notification::assertSentTo($user, ResetPassword::class, function ($notification) { - $response = $this->get('/reset-password/'.$notification->token); + $response = $this->get('/reset-password/' . $notification->token); $response->assertStatus(200); @@ -47,7 +47,7 @@ class PasswordResetTest extends TestCase }); } - public function test_password_can_be_reset_with_valid_token(): void + public function testPasswordCanBeResetWithValidToken(): void { Notification::fake(); diff --git a/tests/Feature/Auth/PasswordUpdateTest.php b/tests/Feature/Auth/PasswordUpdateTest.php index ca28c6c..b22369c 100644 --- a/tests/Feature/Auth/PasswordUpdateTest.php +++ b/tests/Feature/Auth/PasswordUpdateTest.php @@ -11,7 +11,7 @@ class PasswordUpdateTest extends TestCase { use RefreshDatabase; - public function test_password_can_be_updated(): void + public function testPasswordCanBeUpdated(): void { $user = User::factory()->create(); @@ -31,7 +31,7 @@ class PasswordUpdateTest extends TestCase $this->assertTrue(Hash::check('new-password', $user->refresh()->password)); } - public function test_correct_password_must_be_provided_to_update_password(): void + public function testCorrectPasswordMustBeProvidedToUpdatePassword(): void { $user = User::factory()->create(); diff --git a/tests/Feature/Auth/RegistrationTest.php b/tests/Feature/Auth/RegistrationTest.php index 1489d0e..5d86533 100644 --- a/tests/Feature/Auth/RegistrationTest.php +++ b/tests/Feature/Auth/RegistrationTest.php @@ -9,14 +9,14 @@ class RegistrationTest extends TestCase { use RefreshDatabase; - public function test_registration_screen_can_be_rendered(): void + public function testRegistrationScreenCanBeRendered(): void { $response = $this->get('/register'); $response->assertStatus(200); } - public function test_new_users_can_register(): void + public function testNewUsersCanRegister(): void { $response = $this->post('/register', [ 'name' => 'Test User', diff --git a/tests/Feature/ProfileTest.php b/tests/Feature/ProfileTest.php index 252fdcc..5d414c7 100644 --- a/tests/Feature/ProfileTest.php +++ b/tests/Feature/ProfileTest.php @@ -10,7 +10,7 @@ class ProfileTest extends TestCase { use RefreshDatabase; - public function test_profile_page_is_displayed(): void + public function testProfilePageIsDisplayed(): void { $user = User::factory()->create(); @@ -21,7 +21,7 @@ class ProfileTest extends TestCase $response->assertOk(); } - public function test_profile_information_can_be_updated(): void + public function testProfileInformationCanBeUpdated(): void { $user = User::factory()->create(); @@ -43,7 +43,7 @@ class ProfileTest extends TestCase $this->assertNull($user->email_verified_at); } - public function test_email_verification_status_is_unchanged_when_the_email_address_is_unchanged(): void + public function testEmailVerificationStatusIsUnchangedWhenTheEmailAddressIsUnchanged(): void { $user = User::factory()->create(); @@ -61,7 +61,7 @@ class ProfileTest extends TestCase $this->assertNotNull($user->refresh()->email_verified_at); } - public function test_user_can_delete_their_account(): void + public function testUserCanDeleteTheirAccount(): void { $user = User::factory()->create(); @@ -79,7 +79,7 @@ class ProfileTest extends TestCase $this->assertNull($user->fresh()); } - public function test_correct_password_must_be_provided_to_delete_account(): void + public function testCorrectPasswordMustBeProvidedToDeleteAccount(): void { $user = User::factory()->create();