Breadcrumb (diglactic/laravel-breadcrumbs) Gammes en AppService Formattage Prix dans le model Products route pour page : tous les produits
43 lines
1.1 KiB
PHP
43 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use App\Models\ThemeSettings;
|
|
use App\Models\Ranges;
|
|
use Illuminate\Support\Facades\Cache;
|
|
use Illuminate\Support\Facades\View;
|
|
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()
|
|
{
|
|
// 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);
|
|
// caching? --> first need to reset cache upon range change
|
|
// on partage les ranges (gammes produit)
|
|
$ranges = Ranges::all();
|
|
View::share('ranges', $ranges);
|
|
|
|
}
|
|
}
|