by(2); }); // ! Important pourra etre retiré quand la V1 sera supprimé // empeche l'encapsulation dans data JsonResource::withoutWrapping(); // * LOCAL HTTPS FIX. if (!in_array(config('app.env'), ['local', 'testing'])) { URL::forceScheme('https'); } // * HA PROXY FIX. App::singleton('clientIp', function () { if ( config('app.env') === 'local' ) { return request()->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')); // * FORCE BOOTSTRAP PAGINATOR. if (!app()->runningInConsole()) { Paginator::useBootstrap(); } $appInfos = Cache::remember('composer', 360, 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); } }