rockstardev
rockstardev

Reputation: 13547

How to make a URL "un-secure" in Laravel?

I am trying to get the opposite of this:

Route::filter('force.ssl', function()
{
    if( ! Request::secure())
    {
        return Redirect::secure(Request::path());
    }
});

I have this:

Route::filter('no.ssl', function()
{
    if( Request::secure())
    {
        // return ???
    }
});

How do you make a URL not secure in laravel?

Upvotes: 0

Views: 135

Answers (1)

Dave Morrissey
Dave Morrissey

Reputation: 4421

The Redirect facade has a to method that accepts a secure flag as its optional fourth argument. Therefore this should do what you need:

return Redirect::to(Request::path(), null, null, false);

Upvotes: 2

Related Questions