<x-app-layout>

<div class="col-8 offset-md-2">
    <div class="card">
        <div class="card-body">
            <x-form action="{{ route('menu.update',['menu'=>$menu->id] ) }}" method="POST">
                @csrf
             @method('PUT')
                <div class="card">
                    <div class="card-body">
                        <x-form.entity name="parent_id" label="Parent" :items="App\Models\Menu::all()" value="{{ $menu->parent_id }}"  choiceLabel="title" />
                        <x-form.input name="title" value="{{ $menu->title }}" />
                        <x-form.input-group name="icon" value="{{ $menu->icon??'far fa-circle' }}" class="icon">
                            <span class="input-group-text icon-fa">
                                <i class="far fa-circle"></i>
                            </span>
                        </x-form.input-group>
                        <x-form.input name="uri" value="{{ $menu->uri }}" />
                        <x-form.entity name="permission" :items="Spatie\Permission\Models\Permission::all()" value="{{ $menu->permission }}" choiceValue="name" />
                    </div>
                    <div class="card-footer">
                        <x-button class="btn btn-primary"> {{ __('Save') }} </x-button>
                    </div>
                </div>
            </x-form>
        </div>
    </div>
</div>


</x-app-layout>

