- Add Docker configuration (Dockerfile, docker-compose.yml) - Add Nginx and Supervisor configuration - Add deployment documentation (DEPLOYMENT.md) - Complete Phase 3 data migration (63 entries, 63 docs, 28 subs) - Add responsive PDF viewer component - Fix date format to American (MM/DD/YYYY) - Update typography to match v1.0 - Add admin dashboard with full CRUD operations - Configure PostgreSQL with secure password - Connect to caddy_network for reverse proxy - Ready for production deployment
40 lines
1.2 KiB
PHP
40 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Admin;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Models\DocketEntry;
|
|
use App\Models\Document;
|
|
use App\Models\Subscription;
|
|
use Inertia\Inertia;
|
|
use Inertia\Response;
|
|
|
|
class DashboardController extends Controller
|
|
{
|
|
/**
|
|
* Display the admin dashboard with statistics and recent entries.
|
|
*/
|
|
public function index(): Response
|
|
{
|
|
$stats = [
|
|
'total_entries' => DocketEntry::count(),
|
|
'total_documents' => Document::count(),
|
|
'total_subscribers' => Subscription::where('is_active', true)->count(),
|
|
'recent_entries' => DocketEntry::with('documents')
|
|
->latest('date')
|
|
->take(5)
|
|
->get()
|
|
->map(function ($entry) {
|
|
return [
|
|
'id' => $entry->id,
|
|
'date' => $entry->date->format('m/d/Y'),
|
|
'title' => $entry->title,
|
|
'summary' => $entry->summary,
|
|
'documents_count' => $entry->documents->count(),
|
|
];
|
|
}),
|
|
];
|
|
|
|
return Inertia::render('Admin/Dashboard', $stats);
|
|
}
|
|
}
|