2020-10-30 17:26:00 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Providers;
|
|
|
|
|
|
2021-03-05 11:37:13 +01:00
|
|
|
use App\Models\ThemeSettings;
|
|
|
|
|
use Illuminate\Support\Facades\Cache;
|
|
|
|
|
use Illuminate\Support\Facades\View;
|
2020-10-30 17:26:00 +01:00
|
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
|
|
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Register any application services.
|
|
|
|
|
*
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
public function register()
|
|
|
|
|
{
|
|
|
|
|
//
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Bootstrap any application services.
|
|
|
|
|
*
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
public function boot()
|
|
|
|
|
{
|
2021-03-05 11:37:13 +01:00
|
|
|
// On ramène le nom du site et autres infos cross pages
|
|
|
|
|
$settingsGlobal = Cache::get('settingsGlobal');
|
|
|
|
|
if (!$settingsGlobal) {
|
|
|
|
|
$settingsGlobal = ThemeSettings::find(1)->select('site_name', 'company', 'analytics')->where('theme_name','=',config('app.theme'))->first();
|
|
|
|
|
Cache::put('settingsGlobal', $settingsGlobal);
|
|
|
|
|
}
|
|
|
|
|
View::share('settingsGlobal', $settingsGlobal);
|
2020-10-30 17:26:00 +01:00
|
|
|
}
|
|
|
|
|
}
|