D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
forge
/
re-viewers.com
/
app
/
Providers
/
Filename :
SettingsServiceProvider.php
back
Copy
<?php namespace App\Providers; use Illuminate\Support\ServiceProvider; use Illuminate\Support\Facades\View; use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Cache; use App\Models\Setting; class SettingsServiceProvider extends ServiceProvider { /** * Register services. */ public function register(): void { // } /** * Bootstrap services. */ public function boot(): void { if (Schema::hasTable('settings')) { $settings = Cache::rememberForever('settings.first', fn () => Setting::first()); View::share('settings', $settings); } } }