I am working on a project that requires a secure connection.
I can set the route, uri, asset to use 'https' via:
Route::get('order/details/{id}', ['uses' => 'OrderController@details', 'as' => 'order.details', 'https']); url($language.'/index', [], true) asset('css/bootstrap.min.css', true)
But setting the parameters all the time seems tiring.
Is there a way to force all routes to generate HTTPS links?
Laravel Forge automatically redirects HTTP to HTTPS when you activate the SSL certificate. This is done by nginx that handles the certificate on your server, this also includes the traffic that's not being served by your Laravel application (for example static files, like /js/app.
HTTPS Redirection Middleware (UseHttpsRedirection) to redirect HTTP requests to HTTPS.
Place this in the AppServiceProvider in the boot() method
if($this->app->environment('production')) { \URL::forceScheme('https'); }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With