Files
portal-api/resources/views/admin/menu/index.blade.php
T
2025-07-24 16:18:27 +07:00

86 lines
3.9 KiB
PHP

@extends("admin.main")
@section("content")
@if(auth()->guard('admins')->user()->can('manager menu'))
<div class="card card-primary card-outline">
<div class="card-header">
<a href="{{ route('menu.create') }}" class="btn btn-outline-secondary">
<i class="fas fa-plus"></i> Add New Menu
</a>
</div>
<div class="card-body">
<table class="table table-menu table-bordered">
<thead>
<tr>
<th style="width: 10px">
<label for=""></label><input type="checkbox" name="check" class="check-all" id="">
</th>
<th>Tên Danh Mục</th>
<th>Slug</th>
<th>Route</th>
<th>Trạng Thái</th>
<th>Ngày Tạo</th>
<th style="width: 50px">Sửa</th>
<th style="width: 50px">Xóa</th>
</tr>
</thead>
<tbody>
@if(count($menuOptions))
@foreach($menuOptions as $item)
<tr>
<td class="text-center">
<input type="checkbox" name="id[]" value="{{ $item['id'] }}">
</td>
<td class="text-center">
{{ $item['title'] }}
</td>
<td class="text-center">
{{ $item['slug'] ?? '' }}
</td>
<td class="text-center">
{{ $item['route_name'] ?? '' }}
</td>
<td class="text-center">
{{ $item['is_active'] ?? '' }}
</td>
<td class="text-center">
{{ $item['created_at'] ?? '' }}
</td>
<td>
<a class="btn btn-warning btn-sm"
href="{{ route('menu.edit',['id' => $item['id']]) }}">
<i class="fas fa-user-edit"></i>
</a>
</td>
<td>
@if(auth()->guard('admins')->user()->can('delete menu'))
<form method="post" class="d-inline"
action="{{ route('menu.destroy', ['id' => $item['id']]) }}">
@csrf
@method('delete')
<button type="submit" class="btn btn-sm btn-danger">
<i class="fas fa-trash"></i>
</button>
</form>
@endif
</td>
</tr>
@endforeach
@endif
</tbody>
</table>
</div>
<div class="card-footer">
{{-- {{ $menuOptions->links() }}--}}
</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 Payment
management department</h5>
</div>
@endif
@endsection