@php $module = $module ?? 'escrow'; // Permission helper for inventory nav — owners always see everything, // staff only see links they have the grant for. $__invCan = function (?string $ability) { if ($ability === null) return true; $user = auth()->user(); if (! $user) return false; $tenant = app(\App\Modules\Inventory\Services\TenantResolver::class)->current(); if (! $tenant) return false; if ((int) $tenant->user_id === (int) $user->getKey()) return true; $staff = app(\App\Modules\Inventory\Services\TenantResolver::class)->currentStaff(); return $staff && $staff->can_do($ability); }; @endphp