32 lines
614 B
PHP
32 lines
614 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use DB;
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register any application services.
|
|
*/
|
|
public function register(): void
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Bootstrap any application services.
|
|
*/
|
|
public function boot(): void
|
|
{
|
|
$settings = cache()->remember('app_settings', now()->addMinutes(1), function () {
|
|
return (array) DB::table('settings')->find(1);
|
|
});
|
|
if ($settings) {
|
|
config(['app.settings' => (array) $settings]);
|
|
}
|
|
|
|
}
|
|
}
|