@extends('admin::layouts.adm')

@section('content')

    @component('admin::components.page-header', ['breadcrumb' => [
        'Dashboard' => route('Admin'),
        'Lista de $STUDLY_NAME$'
    ]])
        Lista de $STUDLY_NAME$
    @endcomponent


    @component('admin::components.button', [
        'type' => "add",
        'size' => "block",
        'permission' => "$LOWER_NAME$.create",
        'label' => 'Novo $STUDLY_NAME$',
        'url' => route('Admin.$STUDLY_NAME$.create'),
    ])

    <br />

    @endcomponent

    @component('admin::components.panel-tabs', [
        'tabs' => [
            '<i class="fal fa-list"></i> Lista'
        ]
    ])

        @slot('title')
            Lista de $STUDLY_NAME$
        @endslot

        @slot('tab_0')
            {{-- Para ativar a ordenação Drag and Drop utilize o código abaixo no componente de tabela --}}
            {{-- ('admin::components.table'['rowReorder' => true, 'reorderUrl' => Route('Admin.$STUDLY_NAME$.Reorder')]) --}}
            {{-- Para funcionamento correto da ordenação descomente os campos de Ordem e ID --}}

            @component('admin::components.table')

                @slot('thead')
                    {{-- <th>Ordem</th> --}}
                    @foreach( (new \Modules\$STUDLY_NAME$\Entities\$STUDLY_NAME$())->getFillable() as $fillable)
                        <th>{{ $fillable }}</th>
                    @endforeach
                    <th class="t-action">Ação</th>
                    {{-- <th>ID</th> --}}
                @endslot

                @slot('tbody')
                    @foreach( $$LOWER_NAME$Lista as $$LOWER_NAME$ )
                        <tr>
                            {{-- <td>{{ $$LOWER_NAME$->order }}</td> --}}
                            @foreach( (new \Modules\$STUDLY_NAME$\Entities\$STUDLY_NAME$())->getFillable() as $fillable)
                                <td> {{ $$LOWER_NAME$->$fillable }} </td>
                            @endforeach
                            <td class="t-action">

                                @can('$LOWER_NAME$.update')
                                    <a href="{{ route( 'Admin.$STUDLY_NAME$.edit', $$LOWER_NAME$ ) }}" class="btn btn-sm btn-icon btn-primary"><i class="fal fa-pencil"></i></a>
                                @endcan

                                @component('admin::components.button', [
                                    'type' => "delete",
                                    'size' => "small",
                                    'permission' => "$LOWER_NAME$.delete",
                                    'url' => route('Admin.$STUDLY_NAME$.destroy', $$LOWER_NAME$),
                                ])
                                    Você tem certeza? Isso não pode ser desfeito.
                                @endcomponent

                            </td>
                            {{-- <td>{{ $$LOWER_NAME$->id }}</td> --}}
                        </tr>
                    @endforeach

                @endslot

            @endcomponent

        @endslot
    @endcomponent
@stop



