Skip to content

Instantly share code, notes, and snippets.

@tomkel5
Created June 26, 2015 23:31
Show Gist options
  • Save tomkel5/43dda2d377efacddd12d to your computer and use it in GitHub Desktop.
Save tomkel5/43dda2d377efacddd12d to your computer and use it in GitHub Desktop.
Pattern-based After-Filters in Laravel
Route::filter(
'api.filter',
function() {
App::after(
function () {
// Log request/response here...
}
);
}
);
Route::group(
['prefix' => 'api', 'after' => 'api.filter'],
function() {
Route::get(
function() {
// Return Response here...
}
);
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment