Files
2026-07-24 09:45:41 +01:00

6 lines
1.9 KiB
PHP

<x-layouts.app :title="__('Documents')">
<div class="space-y-6"><div class="flex items-center justify-between"><div><h1 class="text-2xl font-semibold">Documents</h1><p class="text-sm text-zinc-500">Manage documents content.</p></div><a href="{{ route('administration.documents.create') }}" class="rounded-lg bg-zinc-900 px-4 py-2 text-sm text-white dark:bg-white dark:text-zinc-900">Add new</a></div>
@if(session('status'))<div class="rounded-lg bg-emerald-50 p-3 text-emerald-800">{{ session('status') }}</div>@endif
<div class="overflow-hidden rounded-xl border border-zinc-200 bg-white dark:border-zinc-700 dark:bg-zinc-900"><table class="w-full text-sm"><thead class="bg-zinc-50 dark:bg-zinc-800"><tr><th class="px-4 py-3 text-left">Title</th><th class="px-4 py-3 text-left">Description</th><th class="px-4 py-3 text-left">File Path</th><th class="px-4 py-3 text-right">Actions</th></tr></thead><tbody class="divide-y divide-zinc-200 dark:divide-zinc-800">@forelse($records as $record)<tr><td class="px-4 py-3">{{ is_array($record->title) ? json_encode($record->title) : Str::limit((string) $record->title, 70) }}</td><td class="px-4 py-3">{{ is_array($record->description) ? json_encode($record->description) : Str::limit((string) $record->description, 70) }}</td><td class="px-4 py-3">{{ is_array($record->file_path) ? json_encode($record->file_path) : Str::limit((string) $record->file_path, 70) }}</td><td class="px-4 py-3 text-right"><a class="mr-3 underline" href="{{ route('administration.documents.edit', $record) }}">Edit</a><form class="inline" method="POST" action="{{ route('administration.documents.destroy', $record) }}">@csrf @method('DELETE')<button class="text-red-600" onclick="return confirm('Delete this record?')">Delete</button></form></td></tr>@empty<tr><td colspan="4" class="px-4 py-10 text-center text-zinc-500">No records yet.</td></tr>@endforelse</tbody></table></div>{{ $records->links() }}</div>
</x-layouts.app>