Improve display of user on accessory show page

This commit is contained in:
Marcus Moore
2025-05-21 16:48:26 -07:00
parent e3ffe79c4c
commit 5f883310b5
3 changed files with 21 additions and 6 deletions
@@ -220,7 +220,10 @@ class AccessoriesController extends Controller
*/
public function show(Accessory $accessory) : View | RedirectResponse
{
$accessory = Accessory::withCount('checkouts as checkouts_count')->find($accessory->id);
$accessory->loadCount('checkouts as checkouts_count');
$accessory->load(['adminuser' => fn($query) => $query->withTrashed()]);
$this->authorize('view', $accessory);
return view('accessories.view', compact('accessory'));
}