@extends('admin.layouts.main-layout')
@section('content')
<div class="container">
    <div class="justify-content-center">
        <div class="">
            <div class="card">
                <div class="card-header">Create Role</div>
                <div class="card-body">
                    @if ($errors->any())
                    <div class="alert alert-danger">
                        <ul>
                            @foreach ($errors->all() as $error)
                            <li>{{ $error }}</li>
                            @endforeach
                        </ul>
                    </div>
                    @endif
                    <form method="post" action="{{ url('admin/roles') }}" onsubmit="return validateForm('addsstatus')" class="addsstatus" autocomplete="off" enctype="multipart/form-data">
                        @csrf
                        <div class="row">
                            <div class="col-md-3">
                                <div class="form-group">
                                    <label for="title"> Role Name <span class="require label-mandatory">*</span></label>

                                    <input type="text" class="form-control input-mandatory" id="banner" name="name" value="" placeholder="Role Name">

                                </div>
                            </div>
                            <div class="col-md-3">
                                <div class="form-group">
                                    <label for="title"> All Permission <span class="require label-mandatory">*</span></label>

                                    <INPUT type="checkbox" onchange="checkAll(this)" name="chk[]"  />

                                </div>
                            </div>
                        </div>
                        <div class="row">
                            @foreach($permission as $value)
                            <div class="col-md-3">
                                <div class="form-group">
                                    <input type="checkbox" name="permission[]" value="{{$value->id}}" >
                                    <span style="    margin-left: 10%;">{{ $value->name }} </span>
                                </div>
                            </div>
                            @endforeach
                        </div>
                        <br>
                        <div class="form-group">

                            <button type="submit" class="btn btn-primary">Submit</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection