getClientIp(); } else { return request()->server('HTTP_X_FORWARDED_FOR') ?? request()->getClientIp(); } }); // * LOCAL FORCE eg: for Carbon setlocale(LC_ALL, \sprintf( '%s_%s.UTF-8', config('app.locale'), \strtoupper(config('app.locale')) )); Carbon::setLocale(config('app.locale')); $this->sharetoView(); } /** * Share Vars to view * * @return void */ private function sharetoView() { 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::defaultView('modules.pagination'); } // * GAMMES if (Schema::hasTable('ranges')) { // On partage les ranges (gammes produit). $ranges = Range::where('status', true)->get(); View::share('PublishedRangesGlobal', $ranges); } } } }