app->environment('production')); // * HTTPS FIX 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')); $this->sharetoView(); JsonResource::withoutWrapping(); Storage::disk('coupons_pdf')->buildTemporaryUrlsUsing( function (string $path, DateTime $expiration, array $options) { return URL::temporarySignedRoute( 'pdf.stream', $expiration, array_merge($options, ['path' => $path]) ); } ); } /** * 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::useBootstrapFive(); } else { Paginator::useBootstrapFive(); } } } }