name) and isset($appInfos->version)) { View::share('cpsr_name', $appInfos->name); View::share('cpsr_version', $appInfos->version); } if (!app()->runningInConsole()) { // * FORCE BOOTSTRAP PAGINATOR (or custom if in front) // Early boot, request wont be filled as expected. if (collect(explode('/', \request()->getPathInfo()))->get(1) === 'bo') { Paginator::defaultView('modules.pagination'); } else { Paginator::useBootstrapFive(); } // FIXME: USe trait cache here // 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('admin', function () { return auth('backend')->user() and auth('backend')->user() ->role->value() <= RoleEnum::admin->value(); }); Blade::if('superadmin', function () { return auth('backend')->user() and auth('backend')->user() ->role->equals(RoleEnum::conceptor); }); } //end if } }