Memoize specialty nav and branch lookups to stop per-request N+1.
Deploy Ladill Care / deploy (push) Successful in 28s
Deploy Ladill Care / deploy (push) Successful in 28s
Sidebar was re-querying practitioners for every specialty module and also calling ensureDefaultModulesProvisioned on each page render, which showed up as multi-second PHP-FPM slow logs on Care. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -7,6 +7,7 @@ use App\Listeners\PlatformServiceEventListener;
|
||||
use App\Models\User;
|
||||
use App\Services\Care\OrganizationResolver;
|
||||
use App\Services\Care\PlanService;
|
||||
use App\Services\Care\SpecialtyModuleService;
|
||||
use Illuminate\Cache\RateLimiting\Limit;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
@@ -18,7 +19,9 @@ class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
public function register(): void
|
||||
{
|
||||
//
|
||||
// Request-scoped memoization for specialty nav / branch scope (avoids N+1 per module).
|
||||
$this->app->singleton(OrganizationResolver::class);
|
||||
$this->app->singleton(SpecialtyModuleService::class);
|
||||
}
|
||||
|
||||
public function boot(): void
|
||||
|
||||
Reference in New Issue
Block a user