diff --git a/app/Http/Middleware/ActiveUser.php b/app/Http/Middleware/ActiveUser.php index 0c54956..870ac72 100644 --- a/app/Http/Middleware/ActiveUser.php +++ b/app/Http/Middleware/ActiveUser.php @@ -11,7 +11,7 @@ class ActiveUser { public function handle(Request $request, Closure $next): mixed { - //if user is not active log the user out + // if user is not active log the user out if (! auth()->user()->is_active) { flash('Your account has been deactivated. You cannot login.')->warning(); auth()->logout(); diff --git a/app/Livewire/Admin/Roles/Edit.php b/app/Livewire/Admin/Roles/Edit.php index 63d4d96..105141c 100644 --- a/app/Livewire/Admin/Roles/Edit.php +++ b/app/Livewire/Admin/Roles/Edit.php @@ -55,7 +55,7 @@ public function mount(): void if (isset($this->role->permissions)) { foreach ($this->role->permissions as $perm) { - //@phpstan-ignore-next-line + // @phpstan-ignore-next-line $this->permissions[] = $perm->name; } } @@ -74,7 +74,7 @@ public function update(): Redirector|RedirectResponse { $this->validate(); - //@phpstan-ignore-next-line + // @phpstan-ignore-next-line $this->role->label = $this->label; $this->role->name = strtolower(str_replace(' ', '_', $this->label)); diff --git a/app/Livewire/Admin/Users/Edit/Profile.php b/app/Livewire/Admin/Users/Edit/Profile.php index 9a4532e..343de70 100644 --- a/app/Livewire/Admin/Users/Edit/Profile.php +++ b/app/Livewire/Admin/Users/Edit/Profile.php @@ -100,7 +100,7 @@ public function update(): void }); $img->stream(); - //@phpstan-ignore-next-line + // @phpstan-ignore-next-line Storage::disk('public')->put('users/'.$name, $img); $this->user->image = 'users/'.$name; diff --git a/app/Livewire/Admin/Users/Edit/Roles.php b/app/Livewire/Admin/Users/Edit/Roles.php index 72068d0..740ebca 100644 --- a/app/Livewire/Admin/Users/Edit/Roles.php +++ b/app/Livewire/Admin/Users/Edit/Roles.php @@ -40,22 +40,22 @@ public function update(): bool $role = Role::where('name', 'admin') ->firstOrFail(); - //if admin role is not in array + // if admin role is not in array if (! in_array(needle: $role->id, haystack: $this->roleSelections, strict: true)) { $adminRolesCount = User::role('admin')->count(); - //when there is only 1 admin role alert user and stop + // when there is only 1 admin role alert user and stop if ($adminRolesCount === 1 && $this->user->hasRole('admin')) { flash('there must be at least one admin user!')->error(); return false; } - //@codeCoverageIgnoreStart + // @codeCoverageIgnoreStart $this->syncRoles(); return false; - //@codeCoverageIgnoreEnd + // @codeCoverageIgnoreEnd } $this->syncRoles(); @@ -65,7 +65,7 @@ public function update(): bool protected function syncRoles(): void { - //@phpstan-ignore-next-line + // @phpstan-ignore-next-line $rolesWithTenant = collect($this->roleSelections)->map(function (string $roleId) { return [ 'role_id' => $roleId, diff --git a/app/Livewire/Admin/Users/Invite.php b/app/Livewire/Admin/Users/Invite.php index 6686e44..00d5be1 100644 --- a/app/Livewire/Admin/Users/Invite.php +++ b/app/Livewire/Admin/Users/Invite.php @@ -64,13 +64,13 @@ public function store(): void 'invited_at' => now(), ]); - //generate image + // generate image $name = get_initials($user->name); $id = $user->id.'.png'; $path = 'users/'; $imagePath = create_avatar($name, $id, $path); - //save image + // save image $user->image = $imagePath; $user->save(); diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index d9ffe85..017111e 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -46,7 +46,7 @@ public function boot(Request $request, UrlGenerator $url): void view()->composer('components.layouts.app', function () { if (auth()->check()) { foreach (Setting::all() as $setting) { - //override config setting + // override config setting config()->set([$setting->key => $setting->value]); } } diff --git a/config/permission.php b/config/permission.php index 8da43c5..05f3167 100644 --- a/config/permission.php +++ b/config/permission.php @@ -78,8 +78,8 @@ /* * Change this if you want to name the related pivots other than defaults */ - 'role_pivot_key' => null, //default 'role_id', - 'permission_pivot_key' => null, //default 'permission_id', + 'role_pivot_key' => null, // default 'role_id', + 'permission_pivot_key' => null, // default 'permission_id', /* * Change this if you want to name the related model primary key other than diff --git a/tests/Feature/App/Http/Controllers/Auth/AuthenticatedSessionControllerTest.php b/tests/Feature/App/Http/Controllers/Auth/AuthenticatedSessionControllerTest.php index db6c269..fb9862e 100644 --- a/tests/Feature/App/Http/Controllers/Auth/AuthenticatedSessionControllerTest.php +++ b/tests/Feature/App/Http/Controllers/Auth/AuthenticatedSessionControllerTest.php @@ -11,8 +11,8 @@ use function Pest\Laravel\post; test('login screen can be rendered', function () { - get(route('login'))->assertOk(); -}); +get(route('login'))->assertOk(); + }); test('users can authenticate using the login screen', function () { $user = User::factory()->create(); diff --git a/tests/Feature/App/Http/Controllers/Auth/PasswordResetTest.php b/tests/Feature/App/Http/Controllers/Auth/PasswordResetTest.php index b473c4b..ddae98d 100644 --- a/tests/Feature/App/Http/Controllers/Auth/PasswordResetTest.php +++ b/tests/Feature/App/Http/Controllers/Auth/PasswordResetTest.php @@ -8,8 +8,8 @@ use function Pest\Laravel\post; test('reset password link screen can be rendered', function () { - get(route('password.request'))->assertOk(); -}); +get(route('password.request'))->assertOk(); + }); test('reset password link can be requested', function () { Notification::fake(); @@ -29,8 +29,8 @@ post(route('password.request'), ['email' => $user->email]); Notification::assertSentTo($user, ResetPassword::class, function ($notification) { - get('/reset-password/'.$notification->token)->assertOk(); + get('/reset-password/'.$notification->token)->assertOk(); return true; - }); + }); }); diff --git a/tests/Feature/App/Http/Controllers/Auth/RegisteredUserControllerTest.php b/tests/Feature/App/Http/Controllers/Auth/RegisteredUserControllerTest.php index 3d332fc..12f5401 100644 --- a/tests/Feature/App/Http/Controllers/Auth/RegisteredUserControllerTest.php +++ b/tests/Feature/App/Http/Controllers/Auth/RegisteredUserControllerTest.php @@ -7,8 +7,8 @@ use function Pest\Laravel\post; test('can see register page', function () { - get(route('register'))->assertOk(); -}); +get(route('register'))->assertOk(); + }); test('users cannot register with invalid password', function () { post(route('register'), [ @@ -49,7 +49,7 @@ }); test('users can register', function () { - //Role::firstOrCreate(['name' => 'admin', 'label' => 'Admin']); + // Role::firstOrCreate(['name' => 'admin', 'label' => 'Admin']); $password = 'ght73A3!$^DS'; $email = fake()->email(); diff --git a/tests/Feature/App/Http/Controllers/Auth/TwoFaControllerTest.php b/tests/Feature/App/Http/Controllers/Auth/TwoFaControllerTest.php index 4982cb5..a2ff690 100644 --- a/tests/Feature/App/Http/Controllers/Auth/TwoFaControllerTest.php +++ b/tests/Feature/App/Http/Controllers/Auth/TwoFaControllerTest.php @@ -12,8 +12,8 @@ }); test('redirects when 2fa has already been verified', function () { - get(route('admin.2fa'))->assertRedirect(route('dashboard')); -}); +get(route('admin.2fa'))->assertRedirect(route('dashboard')); + }); test('renders when 2fa has not been verified', function () { session(['2fa-login' => true]); @@ -65,8 +65,8 @@ }); test('can see 2fa setup page', function () { - get(route('admin.2fa-setup'))->assertOk(); -}); +get(route('admin.2fa-setup'))->assertOk(); + }); test('code is required for update', function () { post(route('admin.2fa-setup.update'), []) diff --git a/tests/Feature/App/Http/Controllers/WelcomeTest.php b/tests/Feature/App/Http/Controllers/WelcomeTest.php index 313df34..141a59f 100644 --- a/tests/Feature/App/Http/Controllers/WelcomeTest.php +++ b/tests/Feature/App/Http/Controllers/WelcomeTest.php @@ -11,17 +11,17 @@ }); test('can see dashboard text on welcome page when logged in', function () { - get('/')->assertSeeText('Dashboard'); - }); + get('/')->assertSeeText('Dashboard'); + }); }); describe('guest', function () { test('can see login text on welcome page', function () { - get('/') - ->assertSeeText('Login') - ->assertSeeText('Register'); - }); + get('/') + ->assertSeeText('Login') + ->assertSeeText('Register'); + }); }); diff --git a/tests/Feature/App/Http/Middleware/AuthenticateTest.php b/tests/Feature/App/Http/Middleware/AuthenticateTest.php index 26c626a..000bac0 100644 --- a/tests/Feature/App/Http/Middleware/AuthenticateTest.php +++ b/tests/Feature/App/Http/Middleware/AuthenticateTest.php @@ -3,6 +3,6 @@ use function Pest\Laravel\get; test('returns 401 when not authenticated', function () { - get(route('dashboard'), ['Accept' => 'application/json']) - ->assertUnauthorized(); -}); +get(route('dashboard'), ['Accept' => 'application/json']) +->assertUnauthorized(); + }); diff --git a/tests/Feature/App/Livewire/Admin/Users/Edit/ProfileTest.php b/tests/Feature/App/Livewire/Admin/Users/Edit/ProfileTest.php index f0c223e..c7f1fe9 100644 --- a/tests/Feature/App/Livewire/Admin/Users/Edit/ProfileTest.php +++ b/tests/Feature/App/Livewire/Admin/Users/Edit/ProfileTest.php @@ -11,7 +11,7 @@ test('can update profile', function () { - //fake image upload + // fake image upload Storage::fake('public'); $image = UploadedFile::fake()->image('avatar.jpg'); @@ -70,7 +70,7 @@ test('image is deleted when a new image is uploaded', function () { - //fake image upload + // fake image upload Storage::fake('public'); $user = auth()->user(); diff --git a/tests/TestCase.php b/tests/TestCase.php index 0f46207..ef011b3 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -18,7 +18,7 @@ protected function setUp(): void $this->withoutVite(); - //$this->withoutExceptionHandling(); + // $this->withoutExceptionHandling(); } public function authenticate(string $role = 'admin', string $permissionName = ''): self