# Phase 4 — Analytics: apply

    cp -R phase4-analytics/app/*        ./app/
    cp -R phase4-analytics/database/*   ./database/
    cp -R phase4-analytics/resources/*  ./resources/
    cp -R phase4-analytics/tests/*      ./tests/

## Routes — merge into routes/web.php (auth + resolve.organization group)

    use App\Http\Controllers\MetricsController;
    use App\Http\Controllers\DashboardsController;

    Route::get('/metrics', [MetricsController::class, 'index'])->name('metrics');
    Route::get('/dashboards', [DashboardsController::class, 'index'])->name('dashboards');
    Route::get('/dashboards/{slug}', [DashboardsController::class, 'show'])->name('dashboards.show');

REMOVE the old '/metrics' and '/dashboards' stub routes from the foreach() stub loop
(leave 'reports', 'goals', 'spaces', 'ai' as stubs for now).

## Seeder — in DatabaseSeeder.php add:

    \Database\Seeders\MetricCatalogSeeder::class,

## Migrate, seed metrics, build, test

    php artisan migrate --force
    php artisan db:seed --class=MetricCatalogSeeder --force
    php artisan test --filter=MetricQuery
    node node_modules/vite/bin/vite.js build

## Seeing real numbers
Once you sync the Rentec mock (tinker snippet from Phase 2), the Metrics page shows
live occupancy %, rent roll, etc. computed through the governed query service.

## Still to come in Phase 4 (next chunk)
- Admin Dashboard Studio (the no-code builder): create/version/publish/assign dashboards
- More widget types (charts, tables, trend), filters, drill-downs, CSV/PDF export
This chunk delivers the metric catalog, governed query service, Metrics page, and
dashboard rendering. The Studio is the next overlay.
