53 lines
2.4 KiB
PHP
53 lines
2.4 KiB
PHP
|
|
<div>
|
||
|
|
@if(session()->has('message'))
|
||
|
|
<div class="alert alert-success mb-2 text-sm">{{ session('message') }}</div>
|
||
|
|
@endif
|
||
|
|
@if(session()->has('error'))
|
||
|
|
<div class="alert alert-error mb-2 text-sm">{{ session('error') }}</div>
|
||
|
|
@endif
|
||
|
|
|
||
|
|
<div class="overflow-x-auto">
|
||
|
|
<table class="table table-zebra w-full">
|
||
|
|
<thead>
|
||
|
|
<tr>
|
||
|
|
<th>{{ __('Name') }}</th>
|
||
|
|
<th>{{ __('Email') }}</th>
|
||
|
|
<th>{{ __('Role') }}</th>
|
||
|
|
<th>{{ __('Language') }}</th>
|
||
|
|
<th>{{ __('Actions') }}</th>
|
||
|
|
</tr>
|
||
|
|
</thead>
|
||
|
|
<tbody>
|
||
|
|
@foreach($users as $user)
|
||
|
|
<tr>
|
||
|
|
<td class="font-medium">{{ $user->name }}</td>
|
||
|
|
<td class="text-sm">{{ $user->email }}</td>
|
||
|
|
<td>
|
||
|
|
<div class="flex flex-wrap gap-1">
|
||
|
|
@foreach($user->roles as $role)
|
||
|
|
<span class="badge badge-sm {{ $role->name === 'Admin' ? 'badge-error' : 'badge-primary' }}">
|
||
|
|
{{ __($role->name) }}
|
||
|
|
</span>
|
||
|
|
@endforeach
|
||
|
|
</div>
|
||
|
|
</td>
|
||
|
|
<td class="text-sm">{{ strtoupper($user->locale ?? 'en') }}</td>
|
||
|
|
<td>
|
||
|
|
@can('assign users')
|
||
|
|
<select wire:change="updateRole({{ $user->id }}, $event.target.value)"
|
||
|
|
class="select select-bordered select-xs"
|
||
|
|
@if(Auth::id() === $user->id && $user->hasRole('Admin')) disabled @endif>
|
||
|
|
@foreach($roles as $role)
|
||
|
|
<option value="{{ $role->name }}" @selected($user->hasRole($role->name))>
|
||
|
|
{{ __($role->name) }}
|
||
|
|
</option>
|
||
|
|
@endforeach
|
||
|
|
</select>
|
||
|
|
@endcan
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
@endforeach
|
||
|
|
</tbody>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
</div>
|