{{-- Helper to generate action buttons with proper authorization --}} @props([ 'model', 'route' => 'customers', 'actions' => ['view', 'edit', 'delete'], 'class' => 'btn-sm' ])
{{-- View Button --}} @if(in_array('view', $actions) && auth()->user()?->can('view', $model)) @endif {{-- Edit Button --}} @if(in_array('edit', $actions) && auth()->user()?->can('update', $model)) @endif {{-- Renew Button (for permits) --}} @if(in_array('renew', $actions) && auth()->user()?->can('renew permits')) @endif {{-- Collect Button (for dues) --}} @if(in_array('collect', $actions) && auth()->user()?->can('collect payments') && $model->remaining_amount > 0) @endif {{-- Delete Button - ONLY FOR SUPER ADMIN --}} @if(in_array('delete', $actions) && auth()->user()?->can('delete', $model) && auth()->user()?->hasRole('super-admin'))
@csrf @method('DELETE')
@endif