@extends('layouts.master')
@section('content')
<div class="card">
	<div class="card-header">
        <h4 class="card-title">Data {{$title}}</h4>
    </div>
    <form action="{{route($route.'.store')}}" method="POST" class="">
        {{csrf_field()}}
        <input type="hidden" name="secure_id" value="{{@$keyId}}">
        <div class="p-6">
            <div class="grid lg:grid-cols-2 gap-3">
                <div class="mb-3">
                    <label class="mb-3">Role</label>
                    <input type="text" value="{{@$item->name ? @$item->name :  old('name')}}" name="name" class="form-input @error('name') is-invalid @enderror" placeholder="Masukan Nama Role" required>
                    @error('name')
                    <span class="invalid-feedback" style="display: block!important;"><strong>{{$message}}</strong></span>
                    @enderror
                </div>
                <div class="mb-3">
                    <label class="mb-3">Alias</label>
                    <input type="text" value="{{@$item->alias ? @$item->alias :  old('alias')}}" name="alias" class="form-input @error('alias') is-invalid @enderror" placeholder="Masukan Alias Role" required>
                    <small><i>Pastikan mengandung huruf kecil semua dan tidak ada "spasi" atau tanda baca "-"</i></small>
                    @error('alias')
                    <span class="invalid-feedback" style="display: block!important;"><strong>{{$message}}</strong></span>
                    @enderror
                </div>
            </div>
        </div>
        <div class="p-6">
            <a href="{{route($route.'.index')}}" class="btn bg-danger text-white"><i class="ri-close-line"></i>&nbsp;Batal</a>
            <button type="submit" class="btn bg-success text-white"><i class="ri-save-line"></i> Simpan</button>
        </div>
    </form>
</div>
@endsection