64 lines
3.0 KiB
PHP
64 lines
3.0 KiB
PHP
@extends("admin.main")
|
|
@section("content")
|
|
@if(auth()->guard('admins')->user()->can("manager role"))
|
|
<div class="card card-primary card-outline">
|
|
<div class="card-header">
|
|
<a href="{{ route('role.create') }}" class="btn btn-outline-secondary"><i
|
|
class="fas fa-plus-circle"></i> Add New Administrator Role</a>
|
|
</div>
|
|
<div class="card-body">
|
|
<table class="table table-invoice table-bordered">
|
|
<thead>
|
|
<tr>
|
|
<th style="width: 10px">
|
|
<label for=""></label><input type="checkbox" name="check" class="check-all" id="">
|
|
</th>
|
|
<th>Role name</th>
|
|
<th style="width: 40px"></th>
|
|
<th style="width: 40px"></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@if($roles->count())
|
|
@foreach($roles->all() as $item)
|
|
<tr>
|
|
<td><input type="checkbox" name="id[]" id="" value="{{ $item->id }}"></td>
|
|
<td>{{ $item->name }}</td>
|
|
<td>
|
|
@if($item->id != 1)
|
|
<a class="btn btn-warning btn-sm"
|
|
href="{{ route('role.edit',['id' => $item->id]) }}">
|
|
<i class="fas fa-user-edit"></i>
|
|
</a>
|
|
@endif
|
|
</td>
|
|
<td>
|
|
@if($item->id != 1 && auth()->guard('admins')->user()->can("delete role"))
|
|
<form method="post" class="d-inline"
|
|
action="{{ route('role.destroy',['id' => $item->id]) }}">
|
|
@csrf
|
|
@method('delete')
|
|
<button type="submit" data-toggle="tooltip" data-placement="top" title=""
|
|
class="btn btn-sm btn-danger" data-original-title="Xoá">
|
|
<i class="fas fa-trash"></i>
|
|
</button>
|
|
</form>
|
|
@endif
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
@endif
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
</div>
|
|
@else
|
|
<div class="alert alert-danger alert-dismissible">
|
|
<h5 class="mb-0"><i class="icon fas fa-ban"></i> Access Denied - You are not assigned to any Role
|
|
management department</h5>
|
|
</div>
|
|
@endif
|
|
|
|
@endsection
|