New-OMIS/resources/views/users/index.blade.php

56 lines
2.0 KiB
PHP
Raw Normal View History

2024-04-04 08:19:00 +00:00
@extends('layouts.app')
@section('content')
<section class="section">
<div class="section-header">
<h1>List users</h1>
</div>
<div class="card">
<div class="card-header d-flex justify-end p-3">
@can('create users')
<a href="{{ route('users.create') }}" class="btn btn-primary btn-sm">New User</a>
@endcan
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table-bordered table">
<thead>
<tr>
<th class="border-1 border">S.N</th>
<th class="border-1 border">Name</th>
<th class="border-1 border">Action</th>
</tr>
</thead>
<tbody>
@can('access users')
@foreach ($users as $permission)
<tr>
<td>{{ $permission->id }}</td>
<td>{{ $permission->name }}</td>
<td>
@can('edit users')
<a href="{{ route('users.edit', $permission->id) }}"
class="btn btn-primary btn-sm rounded-lg text-white"><i class="fas fa-edit"></i></a>
@endcan
@can('delete users')
<form action="{{ route('users.destroy', $permission->id) }}" method="post">
@csrf
@method('delete')
<a href="{{ route('users.destroy', $permission->id) }}"
class="btn btn-danger btn-sm rounded-lg text-white"
onclick="event.preventDefault();this.closest('form').submit();"><i
class="fas fa-trash-alt"></i></a>
</form>
@endcan
</td>
</tr>
@endforeach
@endcan
</tbody>
</table>
</div>
</div>
</div>
</section>
@endsection