runningInConsole()) { $appInfos = Cache::remember('composer', 3600, function () { return json_decode(File::get(\app_path('../composer.json'))); }); View::share('name', $appInfos->name); View::share('version', $appInfos->version); View::share('license', $appInfos->license); // * FORCE BOOTSTRAP PAGINATOR Paginator::defaultView('bo.modules.pagination'); // On ramène le nom du jeu et le nom de la société sur toute les pages. $settingsGlobal = Cache::get('settingsGlobal'); if (!$settingsGlobal) { $settingsGlobal = app(Settings::class) ->select('name', 'company', 'analytics', 'start_date', 'end_date') ->first(); Cache::put('settingsGlobal', $settingsGlobal); } View::share('settingsGlobal', $settingsGlobal); // On ramène aussi tout les prix car on en a besoin sur le header. $prizesGlobal = Cache::get('prizesGlobal'); if (!$prizesGlobal) { $prizesGlobal = Prize::all(); Cache::put('prizesGlobal', $prizesGlobal); } View::share('prizesGlobal', $prizesGlobal); // * CUSTOM IF STATEMENTS Blade::if('superadmin', function () { return auth()->user() && auth()->user()->role == 1; }); } //end if } }