Ok, so I don't know if this can be incorperated, but I notice that laravel doesn't have a way of generating a secure named route. I took a look at the functions. From what I can see, this is what would be required to implement it. If anyone wants to take a look at implementing it further, please feel free. I'm currently testing it to see it there is a way.
public function linkSecureRoute($name, $title = null, $parameters = array(), $attributes = array())
{
return $this->secureLink($this->url->route($name, $parameters), $title, $attributes)
}
if ( ! function_exists('secure_route'))
{
/**
* Generate a HTTPS route url for the application.
*
* @param string $path
* @param mixed $parameters
* @return string
*/
function secure_route($name, $parameters = array(), $absolute = true, $route = null)
{
return app('url')->route($name, $parameters, $absolute, $route);
}
}
hi, first, if you have a named route
Route::post(
'login', array(
'as' => 'front.login',
'https',
....
)
);
if a named route exists, it will look up in routes collections to produce by itself that kind of link
Fortunately, you can not change his "definition" but only his parameters as { id, name ... }, and even more if it's secured or not, besides a complete inconsistency, it could lead to somes security breachs.
regards :)
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community