Files
Motula-Translate-Backend/resources/views/components/table-words.blade.php

40 lines
1.1 KiB
PHP

@props(['items' => []])
@props(['fields' => []])
<table class="table table-striped">
<thead>
<tr>
<th scope="col">ID#</th>
<th scope="col">Italian Word</th>
<th scope="col">Dialect Translation</th>
<th scope="col">Action</th>
</tr>
</thead>
<tbody>
@forelse ($items as $item)
<tr>
<td>{{ $loop->iteration }}</td>
<td>{{ $item->{$fields[0]} }}</td>
<td>{{ $item->{$fields[1]} }}</td>
<td>
@can('edit-user')
<a href="edit_record/{{ $item->id }}"><button class="btn btn-primary btn-xs">Edit</button> </a>
@endcan
@can('delete-user')
<a href="delete_record/{{ $item->id }}"><button class="btn btn-danger btn-xs">Delete</button> </a>
@endcan
</td>
</tr>
@empty
<td colspan="5">
<span class="text-danger">
<strong>No User Found!</strong>
</span>
</td>
@endforelse
</tbody>
</table>