46 lines
1.2 KiB
PHP
46 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use App\Models\ThemeSetting;
|
|
use App\Models\Range;
|
|
use Illuminate\Support\Facades\Cache;
|
|
use Illuminate\Support\Facades\View;
|
|
use Illuminate\Support\ServiceProvider;
|
|
use Illuminate\Support\Facades\Config;
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register any application services.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function register()
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Bootstrap any application services.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function boot()
|
|
{
|
|
// On ramène le nom du site et autres infos cross pages
|
|
// $settingsGlobal = Cache::get('settingsGlobal');
|
|
// if (!$settingsGlobal) {
|
|
// $settingsGlobal = ThemeSetting::where('theme_name', '=', config('app.theme'))->first();
|
|
// Cache::put('settingsGlobal', $settingsGlobal);
|
|
// }
|
|
// $settingsGlobal = config('theme');
|
|
// View::share('settingsGlobal', $settingsGlobal);
|
|
//Config::set('theme', $settingsGlobal);
|
|
|
|
// caching? --> first need to reset cache upon range change
|
|
// on partage les ranges (gammes produit)
|
|
$ranges = Range::all();
|
|
View::share('ranges', $ranges);
|
|
}
|
|
}
|