netgescon-day0/resources/views/superadmin/users/index.blade.php

51 lines
1.9 KiB
PHP

@extends('admin.layouts.netgescon')
@section('title', 'Utenti')
@section('breadcrumb')
<a href="{{ route('superadmin.dashboard') }}">SuperAdmin</a>
<i class="fas fa-chevron-right text-xs"></i>
<span>Utenti</span>
@endsection
@section('content')
<div class="space-y-4">
<div class="flex items-center justify-between">
<h2 class="text-xl font-semibold">Gestione Utenti</h2>
<a href="{{ route('superadmin.users.create') }}" class="netgescon-btn netgescon-btn-primary"><i class="fas fa-plus"></i> Nuovo Utente</a>
</div>
<div class="netgescon-card">
<div class="overflow-x-auto">
<table class="table">
<thead>
<tr>
<th>Nome</th>
<th>Email</th>
<th>Ruoli</th>
<th>Azioni</th>
</tr>
</thead>
<tbody>
@foreach($users as $u)
<tr>
<td>{{ $u->name }}</td>
<td>{{ $u->email }}</td>
<td>{{ $u->roles->pluck('name')->join(', ') }}</td>
<td class="space-x-2">
<a href="{{ route('superadmin.users.edit', $u) }}" class="netgescon-btn netgescon-btn-sm netgescon-btn-outline-secondary">Modifica</a>
<form action="{{ route('superadmin.users.destroy', $u) }}" method="POST" class="inline" onsubmit="return confirm('Eliminare utente?')">
@csrf @method('DELETE')
<button class="netgescon-btn netgescon-btn-sm netgescon-btn-outline-dark">Elimina</button>
</form>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="p-3">{{ $users->links() }}</div>
</div>
</div>
@endsection