Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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