@extends('back-end.master.app')
@section('title', 'Roles')
@section('body')
    <main class="app-content">
        <div class="row">
            <div class="col-md-12">
                <div class="card">

                    <div class="card-body" style="padding:10px;">
                        <div class="row">
                            <div class="col-md-12">
                                <div class="row">
                                    <div class="col-md-9">
                                        <h3 class="">Create Role</h3>
                                    </div>
                                    <div class="col-md-3">
                                        <div class="btn-group" role="group">
                                            <a href="{{ route('roles.index') }}" class="btn btn-sm btn-primary btn-rounded">
                                                List
                                            </a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-12">
                                <form action="{{ route('roles.store') }}" method="post">
                                    @method('post')
                                    @csrf
                                    <div class="col-md-12">
                                        <div class="form-group">
                                            <label for="" class="form-label"> Name</label>
                                            <input class="form-control" type="text" name="name"
                                                placeholder="like Passport Admin...">
                                        </div>
                                    </div>
                                    <div class="col-md-12">
                                        <form action="{{ route('roles.store') }}" method="post">
                                            @method('post')
                                            @csrf
                                            <div class="row">
                                                <div class="col-md-12">
                                                    <div class="list-group">
                                                        @foreach ($permission as $key => $value)
                                                            <li class="list-group-item">
                                                                <label>
                                                                    <input name="permission[]" value="{{ $value->id }}"
                                                                        type="checkbox" class="flat"> {{ $value->name }}
                                                                </label>
                                                            </li>
                                                        @endforeach
                                                    </div>
                                                </div>
                                                <div class="col-md-2 mt-3">
                                                    <button type="submit"
                                                        class="btn btn-primary btn-sm btn-rounded">Save</button>
                                                </div>
                                            </div>

                                        </form>

                                    </div>
                            </div>
                        </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_role").addClass("active");
    </script>
@endsection
