feat: Phase 1 - Redis config, Dashboard cache, Report cache, N+1 fixes, observers
- Add predis/predis for Redis support - Configure cache/queue defaults to redis in config + .env.example - Create DashboardController with 60s cache for dashboard queries - Add cache (5min) to ReportController::generate() and preview() - Add FeatureObserver, InspectionObserver, IssueObserver for cache invalidation - Fix N+1 in ProjectMap (eager load template, images), TaskManager (subtasks.parentTask) - Register observers in AppServiceProvider Tests: 101 passing (319 assertions)
This commit is contained in:
@@ -2,8 +2,14 @@
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Models\Feature;
|
||||
use App\Models\Inspection;
|
||||
use App\Models\Issue;
|
||||
use App\Models\Project;
|
||||
use App\Models\Task;
|
||||
use App\Observers\FeatureObserver;
|
||||
use App\Observers\InspectionObserver;
|
||||
use App\Observers\IssueObserver;
|
||||
use App\Policies\TaskPolicy;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
@@ -25,6 +31,11 @@ class AppServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
// Register model observers for cache invalidation
|
||||
Feature::observe(FeatureObserver::class);
|
||||
Inspection::observe(InspectionObserver::class);
|
||||
Issue::observe(IssueObserver::class);
|
||||
|
||||
// Re-register model bindings so they persist in route cache
|
||||
Route::model('project', Project::class);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user