58 lines
2.5 KiB
PHP
58 lines
2.5 KiB
PHP
@extends('admin::layouts.app')
|
|
|
|
@section('title', 'Users')
|
|
|
|
@section('content')
|
|
<div class="flex items-center justify-between mb-6">
|
|
<h1 class="text-xl font-semibold text-gray-900">Users</h1>
|
|
<a href="{{ route('admin.settings.users.create') }}"
|
|
class="px-4 py-2 bg-indigo-600 hover:bg-indigo-700 text-white text-sm font-medium rounded">
|
|
Add user
|
|
</a>
|
|
</div>
|
|
|
|
<div class="bg-white rounded shadow overflow-hidden">
|
|
<table class="w-full text-sm">
|
|
<thead>
|
|
<tr class="border-b border-gray-200 text-left text-xs font-medium text-gray-500 uppercase tracking-wide">
|
|
<th class="px-4 py-3">Name</th>
|
|
<th class="px-4 py-3">Email</th>
|
|
<th class="px-4 py-3">Created</th>
|
|
<th class="px-4 py-3"></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-gray-100">
|
|
@forelse($users as $user)
|
|
<tr class="hover:bg-gray-50">
|
|
<td class="px-4 py-3 font-medium text-gray-900">
|
|
{{ $user->name }}
|
|
@if($user->id === auth()->id())
|
|
<span class="text-xs text-gray-400">(you)</span>
|
|
@endif
|
|
</td>
|
|
<td class="px-4 py-3 text-gray-500">{{ $user->email }}</td>
|
|
<td class="px-4 py-3 text-gray-400 text-xs">{{ $user->created_at->toDateString() }}</td>
|
|
<td class="px-4 py-3 text-right">
|
|
<a href="{{ route('admin.settings.users.edit', $user) }}"
|
|
class="text-indigo-600 hover:underline mr-3">Edit</a>
|
|
@if($user->id !== auth()->id())
|
|
<form method="POST" action="{{ route('admin.settings.users.destroy', $user) }}"
|
|
class="inline" onsubmit="return confirm('Delete user {{ addslashes($user->name) }}?')">
|
|
@csrf @method('DELETE')
|
|
<button type="submit" class="text-red-500 hover:underline">Delete</button>
|
|
</form>
|
|
@endif
|
|
</td>
|
|
</tr>
|
|
@empty
|
|
<tr>
|
|
<td colspan="4" class="px-4 py-8 text-center text-gray-400">No users.</td>
|
|
</tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
@if($users->hasPages())
|
|
<div class="px-4 py-3 border-t border-gray-100">{{ $users->links() }}</div>
|
|
@endif
|
|
</div>
|
|
@endsection
|