Support the ongoing development of Laravel.io →
Security Views Architecture

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);
    }
}
Last updated 3 years ago.
0

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

https://host/login

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 :)

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

xaoseric xaoseric Joined 3 Mar 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.