Replace the demo home page with a dashboard

Everyone sees their open tasks on an agenda, their open jobs, this
week's hours and quick links. Admin and management also get a lazily
loaded management panel: things to do, the month so far against the
previous month, jobs and late work, and everyone's workload.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
2026-11-25 09:20:02 +02:00
co-authored by Claude Sonnet 5.5
parent d4251d00d7
commit 487a7d34ba
46 changed files with 2032 additions and 62 deletions
@@ -0,0 +1,48 @@
<?php
namespace App\Modules\Dashboard\Infrastructure\Providers;
use App\Models\User;
use App\Modules\Dashboard\Application\Contracts\DashboardAdmin;
use App\Modules\Dashboard\Application\Contracts\DashboardFigures;
use App\Modules\Dashboard\Application\Contracts\DashboardTime;
use App\Modules\Dashboard\Application\Contracts\DashboardWork;
use App\Modules\Dashboard\Infrastructure\Adapters\AdminForDashboard;
use App\Modules\Dashboard\Infrastructure\Adapters\FiguresForDashboard;
use App\Modules\Dashboard\Infrastructure\Adapters\TimeForDashboard;
use App\Modules\Dashboard\Infrastructure\Adapters\WorkForDashboard;
use Illuminate\Support\Facades\Gate;
use Illuminate\Support\ServiceProvider;
use Livewire\Livewire;
/**
* Wires the Dashboard module (the home page) into Laravel: the ports to
* the other modules, the home route, the `dashboard::` Livewire namespace
* and the `dashboard.management` ability.
*/
class DashboardServiceProvider extends ServiceProvider
{
/**
* @var array<class-string, class-string>
*/
public array $bindings = [
DashboardWork::class => WorkForDashboard::class,
DashboardTime::class => TimeForDashboard::class,
DashboardAdmin::class => AdminForDashboard::class,
DashboardFigures::class => FiguresForDashboard::class,
];
public function boot(): void
{
$presentationPath = dirname(__DIR__, 2).'/Presentation';
Livewire::addNamespace('dashboard', viewPath: $presentationPath.'/Livewire');
if (! $this->app->routesAreCached()) {
$this->loadRoutesFrom($presentationPath.'/Routes/web.php');
}
// The management panel of the home page: admin and management.
Gate::define('dashboard.management', fn (User $user): bool => $user->role->seesAllMoney());
}
}