fix: add exception handling to ViewServiceProvider boot method to prevent application crashes on database errors

This commit is contained in:
Yoga Pangestu 2026-04-22 14:14:34 +07:00
parent 09d70d052b
commit 3f8ca0c6d9

View File

@ -25,6 +25,7 @@ public function register(): void
*/ */
public function boot(): void public function boot(): void
{ {
try {
if (Schema::hasTable('settings')) { if (Schema::hasTable('settings')) {
view()->share('general', app(GeneralSettings::class)); view()->share('general', app(GeneralSettings::class));
view()->share('social', app(SocialMediaSettings::class)); view()->share('social', app(SocialMediaSettings::class));
@ -48,5 +49,7 @@ public function boot(): void
]); ]);
}); });
} }
} catch (\Throwable $th) {
}
} }
} }