(PHP) Using route groups in Laravel to protect routes

By | March 18, 2015

To protect routes, in Laravel, from unauthorized visits you can use route groups.
All routes in group will be affected by the auth before filter.

Route::group(array('before' => 'auth'), function() {

    Route::get('controlpanel', '[email protected]');
    Route::get('secret', '[email protected]');
    Route::post('setup', '[email protected]');

});

Leave a Reply

Your email address will not be published. Required fields are marked *