We will see how to force the routes created with the url() and URL::to() helpers to use HTTPS instead of HTTP in Laravel 5.2 without modifying all our views one by one, for this we will go to the file:
\App\Providers\AppServiceProvider.php
where within the boot() function we have to add the following code:
if (\App::environment('production')) { \URL::forceSchema('https'); }
In this case we are first checking if in our .env file we have set the environment as production, if this is the case it will force the use of HTTPS in the routes created with the url() and URL::to() helpers.
That's all, I hope it helps more than one
Tested in Laravel 5.1 and 5.2
Page loaded in 30.56 ms