Last active
January 4, 2016 01:29
-
-
Save damonsharp/8549031 to your computer and use it in GitHub Desktop.
Laravel - Filtering of Route::resource() Suggestion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Instead of this... | |
Route::group(array('before' => 'language'), function(){ | |
Route::resource('registrations', 'RegistrationsController', array('only' => array('index', 'store'))); | |
}); | |
// Maybe something like this... | |
Route::resource('registrations', array('before' => 'filter_name', 'for' => array('index')), 'RegistrationsController', array('only' => array('index', 'store'))); | |
// Or another implementation, but you get the idea. I know this can be done in a controller method, but it's just a thought. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment