app->environment('production')); // * HTTPS FIX URL::forceScheme('https'); // * HA PROXY FIX. App::singleton('clientIp', function () { if (config('app.env') === 'local') { return \IPLib\Factory::parseAddressString(request()->getClientIp()); } else { return \IPLib\Factory::parseAddressString( 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')); Pluralizer::useLanguage('french'); // * Settings Provider app()->singleton(Settings::class, function () { if (!($settings = Settings::getCached()->first())) { throw new \ErrorException('Settings not found in DB'); } return $settings; }); } }