I'm using Laravel 5.4 and have a question. Is it possible to generate an https URL of the specific URL? I have a URL, e.g: login, and want to open it in https, not HTTP. how can I force Laravel to open url('login') in https mode?
2 Answers
There is helper function secure_url(). The secure_url function generates a fully qualified HTTPS URL to the given path for e.g
$url = secure_url('user/profile'); 1 Comment
Meysam Mahmoudi
Thanks, This is what I was looking for.
If you want only some links in https, you can try this (force a group of routes to https):
Route::group(['scheme' => 'https'], function () { // Route::get(...)->name(...); }); Similar to this question: How to force Laravel Project to use HTTPS for all routes?
httpvshttpsis configured by your server, not by Laravel.httpbut others usehttps. I would think that if you havehttps, everything should use it. See if that works for you though.