I want all the links on my site to use HTTPS; however I cannot (for non technical reasons) force users to use HTTPS. I therefore want all URLs generated by Laravel to be prefixed with 'https', but I don't want Laravel to throw an exception if a user visits the URL over 'http'.
I have the following route setup:
Route::get('dashboard', [ 'uses'=>'DashboardController@view' ]);
Can anyone tell me how to get URL::route('dashboard')
to return a HTTPS version of the URL, without rewriting my route as:
Route::get('dashboard', [ 'https', 'uses'=>'DashboardController@view' ]);
Or how to write my route as per the second example, but not thrown an exception if then accessed over 'http'?