mad-lawsuit/app/Http/Controllers/Admin/DashboardController.php
TheMaddax b7125cf2b7 Phase 4: Production deployment configuration
- 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
2025-12-17 19:12:32 -07:00

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);
}
}