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('bo.modules.pagination'); } else { Paginator::useBootstrapFive(); } // Get all the stamps that are pubished. $stamps = Cache::remember('randomStampsFooter', 360, function () { return DB::table('stamps') ->select('picture', 'picture_alt', 'picture_title') ->where('published', true) ->get(); }); /** * Share a collection of 1 or 2 random stamps for footer. * First, check if $stamps is not empty, if not, * we count if the number of stamp in $stamps is greater than 2. * Then, pick 1 or 2 stamp(s) depending on the number of stamps. */ View::share( 'randomStampsFooter', $stamps->isNotEmpty() ? $stamps->random($stamps->count() >= 2 ? 2 : 1) : [] ); }//end if } }