LaravelCollective / annotations

Route and Event Annotations for the Laravel Framework
MIT License
365 stars 73 forks source link

what is proper way to implement the 'web' middleware group introduced in laravel 5.2? #44

Closed vesper8 closed 8 years ago

vesper8 commented 8 years ago

I'm having a hard time understanding how to make a whole controller require auth now that the 'web' middleware group was introduced in 5.2

It seems that the way that is intended is to put all the routes inside of a

Route::group(['middleware' => 'web'], function() {

    // Existing routes go here

});

But how does that translate to annotations?

vesper8 commented 8 years ago

nevermind... it was as simple as adding this to the top

/**
 * @Middleware("web")
 * @Middleware("auth")
 */