@foreach ($actions as $action)
        @if (! empty($action['permission']))
            @can($action['permission'])
        @endif
        @if ($count_buttons > 3 && $loop->count > 4)
            @break
        @endif
        @php
            $type = ! empty($action['type']) ? $action['type'] : 'link';
        @endphp
        @switch($type)
            @case('button')
                
                @break
            @case('delete')
                @php
                    $title = $action['title'] ?? null;
                    $modelId = ! empty($action['model-id']) ? $action['model-id'] : 'id';
                    $modelName = ! empty($action['model-name']) ? $action['model-name'] : 'name';
                @endphp
                
                @break
            @default
                
                    
                        {{ $action['icon'] }}
                    
                    
                
        @endswitch
        @php
            array_shift($actions);
            $count_buttons++;
        @endphp
        @if (! empty($action['permission']))
            @endcan
        @endif
    @endforeach
    @foreach ($actions as $action)
        @if (! empty($action['permission']))
            @can($action['permission'])
            @php $more_actions[] = $action; @endphp
            @endcan
        @else
            @php $more_actions[] = $action; @endphp
        @endif
    @endforeach
    @if ($more_actions)
        @php $divider = false; @endphp
        
            
                
                @foreach ($more_actions as $action)
                    @php
                        $type = ! empty($action['type']) ? $action['type'] : 'link';
                    @endphp
                    @switch($type)
                        @case('button')
                            @php $divider = false; @endphp
                            
                                
                            
                            @break
                        @case('delete')
                            @php $divider = false; @endphp
                            @php
                                $title = $action['title'] ?? null;
                                $modelId = ! empty($action['model-id']) ? $action['model-id'] : 'id';
                                $modelName = ! empty($action['model-name']) ? $action['model-name'] : 'name';
                            @endphp
                            
                            @break
                        @case('divider')
                            @if (! $divider)
                                @php $divider = true; @endphp
                                
                            @endif
                            @break
                        @default
                            @php $divider = false; @endphp
                            
                    @endswitch
                @endforeach
            
 
    @endif