We have a simple route defined like the following one:
Route
// Home
Route::get('/home', [
'as' => 'home::index',
'uses' => 'IndexController@home'
]);
View
<a href="{{ route('home::index') }}">Home</a>
We need to force our link/route in view rendered as HTTP or in some cases as HTTPS route e.g. http://host.domain/home
or https://host.domain/home
.
We cannot use URL::forceSchema("http")
or URL::forceSchema("https")
since we need to force HTTPS on a HTTP page and HTTP on a HTTPS page. We have a multidomain application. Some domains running via HTTP some via HTTPS. A link to different domain / "application section" can be placed everywhere. A domain running via HTTPS cant be accessed via HTTP. A domain running on HTTP cant be accessed via HTTPS
How to force a route rendered as a specific hypertext protocol?