Define dynamically routes in Laravel
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() ]
]);
});
}
}