Skip to content

Commit cbb338d

Browse files
committed
wip
1 parent 4dac846 commit cbb338d

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

app/Http/Controllers/Admin/UsersController.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function ban(BanRequest $request, User $user): RedirectResponse
4040

4141
$this->dispatchSync(new BanUser($user, $request->get('reason')));
4242

43-
if ($request->get('delete_threads')) {
43+
if ($request->willDeleteThreads()) {
4444
$this->dispatchSync(new DeleteUserThreads($user));
4545
}
4646

@@ -81,6 +81,4 @@ public function deleteThreads(User $user): RedirectResponse
8181

8282
return redirect()->route('admin.users');
8383
}
84-
85-
8684
}

app/Http/Requests/BanRequest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,17 @@ public function rules(): array
1515
{
1616
return [
1717
'reason' => 'required|string',
18-
'delete_threads' => 'required|boolean',
18+
'delete_threads' => 'boolean',
1919
];
2020
}
2121

2222
public function reason(): string
2323
{
2424
return $this->get('reason');
2525
}
26+
27+
public function willDeleteThreads(): bool
28+
{
29+
return $this->boolean('delete_threads');
30+
}
2631
}

resources/views/admin/users.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
{{ $user->createdAt()->format('j M Y H:i:s') }}
6969
</x-tables.table-data>
7070

71-
<x-tables.table-data class="text-center w-32">
71+
<x-tables.table-data class="text-center w-18">
7272
<a href="{{ route('profile', $user->username()) }}" class="text-lio-600 hover:text-lio-800">
7373
<x-heroicon-o-user-circle class="w-5 h-5 inline" />
7474
</a>
@@ -83,7 +83,7 @@
8383
</x-modal>
8484

8585
<button title="Delete {{ $user->name() }} threads." @click="activeModal = 'deleteUserThreads{{ $user->getKey() }}'" class="text-red-600 hover:text-red-800">
86-
<x-heroicon-o-chat-bubble-oval-left class="w-5 h-5 inline" />
86+
<x-heroicon-o-archive-box-x-mark class="w-5 h-5 inline" />
8787
</button>
8888

8989
<x-modal identifier="deleteUserThreads{{ $user->getKey() }}" :action="route('admin.users.threads.delete', $user->username())" title="Delete {{ $user->username() }} threads">

0 commit comments

Comments
 (0)