@extends('back-end.master.app')
@section('title', 'Update permission')

@section('body')
    <main class="app-content">
        <div class="row">
            <div class="col-md-12">
                <div class="tile">
                    <div class="tile-title-w-btn">
                        <h3 class="title">Edit </h3>
                        <div class="btn-group" role="group">
                            <a href="{{ route('permission.index') }}" class="btn btn-outline-primary">
                                <i class="fa fa-list-alt"></i> List
                            </a>
                        </div>
                    </div>
                    <hr />
                    <div class="tile-body row">
                        <div class="col-md-8 offset-md-2">
                            <form method="POST" action="{{ route('permission.update', $permission->id) }}"
                                enctype="multipart/form-data">
                                @csrf
                                @method('PUT')



                                <div class="form-group row">
                                    <label for="name"
                                        class="col-md-4 col-form-label text-md-right">{{ __('Name') }}</label>

                                    <div class="col-md-6">
                                        <input id="name" type="text"
                                            class="form-control @error('name') is-invalid @enderror" name="name"
                                            value="{{ $permission->name }}" required autocomplete="name" autofocus>

                                        @error('name')
                                            <span class="invalid-feedback" role="alert">
                                                <strong>{{ $message }}</strong>
                                            </span>
                                        @enderror
                                    </div>
                                </div>



                                <div class="form-group row mb-0">
                                    <div class="col-md-6 offset-md-4">
                                        <button type="submit" class="btn btn-primary">
                                            {{ __('Update') }}
                                        </button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </main>

@endsection


@section('pageJs')
    <script type="text/javascript">
        $(".app-menu").removeClass("active");
        $("#nav_account").addClass("active");
        $("#nav_accounti").addClass("is-expanded");
        $("#nav_permission").addClass("active");
    </script>
@endsection
