Skip to content

Instantly share code, notes, and snippets.

@damonsharp
Last active January 4, 2016 01:29
Show Gist options
  • Save damonsharp/8549031 to your computer and use it in GitHub Desktop.
Save damonsharp/8549031 to your computer and use it in GitHub Desktop.
Laravel - Filtering of Route::resource() Suggestion
// 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