From 90fdaa80171f40cfdc38eecab1e8ffbdc20a1858 Mon Sep 17 00:00:00 2001 From: TR Tajim Date: Sat, 24 Oct 2026 23:12:05 +0600 Subject: [PATCH] fix(cache): serialize notice as array to prevent __PHP_Incomplete_Class on cache hits --- app/Models/Notice.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Models/Notice.php b/app/Models/Notice.php index 18c718f8..f77f07b9 100644 --- a/app/Models/Notice.php +++ b/app/Models/Notice.php @@ -36,10 +36,10 @@ public static function singleton(): self ]); } - public static function activeForDisplay(): ?self + public static function activeForDisplay(): ?array { return Cache::rememberForever('active_notice_for_display', function () { - return static::where('is_active', true)->first(); + return static::where('is_active', true)->first()?->toArray(); }); } }