<?php
use App\Models\Role;
use Illuminate\Support\Facades\Auth;
use App\Models\Cucina;
?>
@php
$configData = Helper::appClasses();
@endphp

@extends('layouts/layoutMaster')

@section('title', 'Piatti')

@section('vendor-style')
@vite([
'resources/assets/vendor/libs/datatables-bs5/datatables.bootstrap5.scss',
'resources/assets/vendor/libs/datatables-responsive-bs5/responsive.bootstrap5.scss',
'resources/assets/vendor/libs/datatables-buttons-bs5/buttons.bootstrap5.scss',
'resources/assets/vendor/libs/flatpickr/flatpickr.scss',
'resources/assets/vendor/libs/@form-validation/form-validation.scss'
])
@endsection

<!-- Vendor Scripts -->
@section('vendor-script')
@vite([
'resources/assets/vendor/libs/moment/moment.js',
'resources/assets/vendor/libs/flatpickr/flatpickr.js',
'resources/assets/vendor/libs/@form-validation/popular.js',
'resources/assets/vendor/libs/@form-validation/bootstrap5.js',
'resources/assets/vendor/libs/@form-validation/auto-focus.js',
'resources/assets/vendor/libs/@form-validation/popular.js',
'resources/assets/vendor/libs/@form-validation/bootstrap5.js',
'resources/assets/vendor/libs/@form-validation/auto-focus.js',
'resources/assets/vendor/libs/datatables-bs5/datatables-bootstrap5.js'
])
@endsection


@section('pageTitle')
<div class="d-flex flex-column">
  <h4 class="mb-1 text-sm-small mt-md-4 mt-lg-4">
    <i class="bx bx-dish d-none d-md-inline-flex d-lg-inline-flex"></i> Piatti
    @if(request()->get('cucina_id'))
       della cucina <strong class="text-primary">{{ Cucina::find(request()->get('cucina_id'))->nome }}</strong>
    @endif
  </h4>
  <nav aria-label="breadcrumb" style="font-size: smaller;" class="d-none d-md-block d-lg-block">
            <ol class="breadcrumb breadcrumb-custom-icon">
      
              <li class="breadcrumb-item">
                <a href="#">Configurazioni</a>
                <i class="breadcrumb-icon icon-base bx bx-chevron-right align-middle"></i>
              </li>
              <li class="breadcrumb-item active text-primary">
                <a href="{{ route('piatto.index') }}">Piatti</a>
              </li>
              @if(request()->get('cucina_id'))
              <li class="breadcrumb-item active text-primary">
                <a href="{{ route('piatto.index', ['cucina_id' => request()->get('cucina_id')]) }}">{{ Cucina::find(request()->get('cucina_id'))->nome }}</a>
              </li>
              @endif
            </ol>
          </nav>
</div>
@endsection


@section('content')
<style>
  div.upload button:first-child{
    display: none !important;
  }


</style>

@if(session('status'))
<div class="alert alert-success">
  {{ session('status') }}
</div>
@endif

<div class="row justify-content-center">
  <div class="col-xxl mb-4 mt-2">
    <div class="card">
      <div class="card-body">
        {{ $dataTable_piatto->table(['class' => 'table table-bordered']) }}
      </div>
    </div>
  </div>
</div>

@endsection

@section('page-script')
@include('piatto.datatable_script')
@endsection
