<x-app-layout>
    @section('title')
    Staff Create
    @endsection
    <!-- DataTales Example -->
    <div class="row">
        <div class="col-md-12 m-auto">
            <h1 class="h3 mb-2 text-gray-800">
                <a href="{{ route('admin.users.index') }}" class="btn btn-primary"><i class="fas fa-list"
                        aria-hidden="true"></i> Listing Staff
                </a>
            </h1>
            {{-- @include('admin.layouts.partials.validation') --}}
            <div class="card shadow mb-4">
                <div class="card-header py-3">
                    <h6 class="m-0 font-weight-bold text-primary">
                        Listing Staff Form
                    </h6>
                </div>
                <div class="card-body">
                    <form id="quickForm" novalidate="novalidate" action="{{ route('admin.users.store') }}"
                        method="POST">
                        @csrf
                        @method('POST')

                        <div class="form-group">
                            <label for="name" class="mb-0">User Name <span class="text-danger">*</span></label>
                            <input type="text" class="form-control @error('name') is-invalid @enderror" id="name" name="name" placeholder="Enter Name" value="{{ old('name') }}">
                            @error('name')
                                <p class="alert alert-danger">{{ $message }}</p>
                            @enderror
                        </div>


                        <div class="form-group">
                            <label for="email" class="mb-0">User Email <span class="text-danger">*</span></label>
                            <input type="text" class="form-control @error('email') is-invalid @enderror" id="email" name="email" placeholder="Enter email" value="{{ old('email') }}">
                            @error('email')
                                <p class="alert alert-danger">{{ $message }}</p>
                            @enderror
                        </div>


                        <div class="form-group">
                            <label for="password" class="mb-0">Password <span class="text-danger">*</span></label>
                            <input type="password" class="form-control @error('password') is-invalid @enderror" id="password" name="password"
                                                placeholder="Enter Password" value="{{ old('password') }}">
                            @error('password')
                                <p class="alert alert-danger">{{ $message }}</p>
                            @enderror
                        </div>


                        <div class="form-group">
                            <label for="password_confirmation" class="mb-0">Confirm Password <span class="text-danger">*</span></label>
                            <input type="password" class="form-control @error('password_confirmation') is-invalid @enderror" id="password_confirmation"
                                                name="password_confirmation" placeholder="Re-enter password">
                            @error('password_confirmation')
                                <p class="alert alert-danger">{{ $message }}</p>
                            @enderror
                        </div>

                        <div class="form-row">
                            <div class="form-group col-md-12 col-sm-12">
                                <label for="password" class="mb-0">Assign Roles <span class="text-danger">*</span></label>
                                <select name="roles[]" id="roles" class="form-control select2 @error('roles') is-invalid @enderror" multiple>
                                    @foreach($roles as $role)
                                        <option value="{{$role->id}}">{{ $role->name }}</option>
                                    @endforeach
                                </select>
                            @error('roles')
                                <p class="alert alert-danger">{{ $message }}</p>
                            @enderror
                            </div>
                        </div>

                        <button type="submit" class="btn btn-success">
                            Save
                        </button>
                    </form>
                </div>
            </div>
        </div>
    </div>
</x-app-layout>
