diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index 5b2df8b..d30175b 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -17,7 +17,7 @@ class UserFactory extends Factory public function definition(): array { return [ - 'name' => fake()->firstName().' '.fake()->lastName(), + 'name' => fake()->firstName().' '.str_replace("'", '', fake()->lastName()), 'uniqueid' => $id = fake()->unique()->safeEmail(), 'email' => $id, 'emails' => random_int(0, 1) ? "$id;".fake()->safeEmail() : null, diff --git a/resources/views/components/user-status.blade.php b/resources/views/components/user-status.blade.php index 951e7d4..8bd9f2c 100644 --- a/resources/views/components/user-status.blade.php +++ b/resources/views/components/user-status.blade.php @@ -20,7 +20,7 @@ class="dark:bg-indigo-800 dark:text-indigo-100 px-2 ml-2 text-xs font-semibold t @endif -@if ($model->manager) +@if ($model->manager && !$model->admin) {{ __('common.manager') }} diff --git a/resources/views/users/show.blade.php b/resources/views/users/show.blade.php index 4096819..763e3df 100644 --- a/resources/views/users/show.blade.php +++ b/resources/views/users/show.blade.php @@ -69,7 +69,8 @@ 'users.partials.status') @includeWhen(request()->user()->can('do-everything') && - !request()->user()->is($user), + !request()->user()->is($user) && + !$user->admin, 'users.partials.subrole') @includeWhen(request()->user()->can('do-everything') && diff --git a/tests/Feature/Http/Controllers/FakeControllerTest.php b/tests/Feature/Http/Controllers/FakeControllerTest.php index fd53038..c7fcd7f 100644 --- a/tests/Feature/Http/Controllers/FakeControllerTest.php +++ b/tests/Feature/Http/Controllers/FakeControllerTest.php @@ -24,7 +24,7 @@ public function a_user_can_log_in_using_fakecontroller(): void $this ->followingRedirects() ->from('/') - ->post(route('fakelogin'), ['id' => 1]) + ->post(route('fakelogin'), ['id' => $user->id]) ->assertOk(); $user->refresh();