{{-- resources/views/components/admin/page-header.blade.php --}} {{-- Page header: breadcrumb navigation + optional "Add New" button --}} {{-- The page title is shown in the topbar via @section('page_title') --}} {{-- Props: title (used for accessibility), breadcrumb[], buttonLabel, buttonRoute, module --}} {{-- module: e.g. 'countries' — used to check create permission before showing the button --}} @props([ 'title' => '', 'breadcrumb' => [], 'buttonLabel' => null, 'buttonRoute' => null, 'module' => '', // e.g. 'countries' — gates the Add New button on create permission ]) @php $u = auth()->user(); $isAdmin = $u->hasRole('admin'); // Can show button if: no module specified (legacy), admin, or user has module.create permission $canCreate = !$module || $isAdmin || $u->permissions->contains('name', $module . '.create'); @endphp