Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Proposal] Ability to force route groups to be served over HTTPS #578

Closed
maxhoffmann opened this issue Mar 14, 2013 · 4 comments
Closed

Comments

@maxhoffmann
Copy link

Since it’s possible to force a route to be served over HTTPS it would be cool to have the same ability for route groups too instead of writing a custom filter for that purpose.

Proposed syntax:

// Solution 1
Route::group(array('prefix' => 'secure'), array('https', function()
{
  // code
}));

// Solution 2
Route::group(array('https', 'prefix' => 'secure'), function()
{
  // code
});
@JoostK
Copy link
Contributor

JoostK commented Mar 14, 2013

Doesn't this already work?

@maxhoffmann
Copy link
Author

Doesn’t work for me. Solution 2 is ignored and Solution 1 throws an error:

ErrorException: Catchable Fatal Error: Argument 2 passed to Illuminate\Routing\Router::group() must be an instance of Closure, array given, called in /Users/maxhoffmann/Sites/laravel4/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php on line 169 and defined in /Users/maxhoffmann/Sites/laravel4/vendor/laravel/framework/src/Illuminate/Routing/Router.php line 588

@taylorotwell
Copy link
Member

What do you mean solution 2 is ignored? I just tried it and it seems to work?

@maxhoffmann
Copy link
Author

Sorry, catched all exceptions except for 405 and my default message was thrown. My bad! Anyway would be great if this possibility is mentioned in the documentation. Thanks guys!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants