@extends('[% layout_name %]')

@section('content')

    <div class="card text-bg-theme">
  
         <div class="card-header d-flex justify-content-between align-items-center p-3">
            <h4 class="m-0">{{ !empty([% model_header %]) ? [% model_header %] : '[% model_name_title %]' }}</h4>
            <div>
                <a href="{{ route('[% index_route_name %]') }}" class="btn btn-primary" title="[% show_all_models %]">
                    <span class="fa-solid fa-table-list" aria-hidden="true"></span>
                </a>

                <a href="{{ route('[% create_route_name %]') }}" class="btn btn-secondary" title="[% create_model %]">
                    <span class="fa-solid fa-plus" aria-hidden="true"></span>
                </a>
            </div>
        </div>

        <div class="card-body">

            @if ($errors->any())
                <div class="alert alert-danger" role="alert">
                    <ul class="list-unstyled mb-0">
                        @foreach ($errors->all() as $error)
                            <li>{{ $error }}</li>
                        @endforeach
                    </ul>
                </div>
            @endif

            <form method="POST" class="needs-validation" novalidate action="{{ route('[% update_route_name %]', $[% model_name_singular_variable %]->[% primary_key %]) }}" id="[% form_id %]" name="[% form_name %]" accept-charset="UTF-8" [% upload_files %]>
            {{ csrf_field() }}
            <input name="_method" type="hidden" value="PUT">
            @include ('[% form_view_name %]', [
                                        '[% model_name_singular_variable %]' => $[% model_name_singular_variable %],
                                      ])

                <div class="col-lg-10 col-xl-9 offset-lg-2 offset-xl-3">
                    <input class="btn btn-primary" type="submit" value="[% update %]">
                </div>
            </form>

        </div>
    </div>

@endsection