Skip to content

Instantly share code, notes, and snippets.

@dusterio
Created November 14, 2016 03:54
Show Gist options
  • Save dusterio/3dfd10c268d5eb7b6bbc43d77cfdd372 to your computer and use it in GitHub Desktop.
Save dusterio/3dfd10c268d5eb7b6bbc43d77cfdd372 to your computer and use it in GitHub Desktop.
<?php
class RouteRegistry
{
/**
* @param Application $app
*/
public function bind(Application $app)
{
$this->getRoutes()->each(function ($route) use ($app) {
$method = strtolower($route->getMethod());
$app->{$method}($route->getPath(), [
'uses' => 'App\Http\Controllers\GatewayController@' . $method,
'middleware' => [ 'auth', 'helper:' . $route->getId() ]
]);
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment