fixed cache and email creation from url

This commit is contained in:
Gitea
2025-04-28 05:36:36 +05:30
parent e0d260187d
commit a72b7f48a8
3 changed files with 16 additions and 12 deletions

View File

@@ -22,20 +22,19 @@ class AppServiceProvider extends ServiceProvider
*/
public function boot(): void
{
$settings = cache()->remember('app_settings', now()->addSecond(1), function () {
$settings = cache()->remember('app_settings', now()->addHours(6), function () {
return (array) DB::table('settings')->find(1);
});
$menus = Menu::all();
$blogs = Blog::where(['is_published' => 1])->get();
if ($settings) {
config(['app.settings' => (array) $settings]);
}
if ($menus) {
config(['app.menus' => $menus]);
}
if ($blogs) {
config(['app.blogs' => $blogs]);
}
$menus = cache()->remember('app_menus', now()->addHours(6), function () {
return Menu::all();
});
$blogs = cache()->remember('app_blogs', now()->addHours(6), function () {
return Blog::where('is_published', 1)->get();
});
config(['app.settings' => (array) $settings]);
config(['app.menus' => $menus]);
config(['app.blogs' => $blogs]);
}
}