1
0
mirror of https://github.com/flarum/core.git synced 2025-07-23 09:41:26 +02:00

Implement helper for generating routes in API actions.

This commit is contained in:
Franz Liedke
2015-05-27 23:59:41 +02:00
parent c4012ed718
commit c76fbd03c7

View File

@@ -46,6 +46,14 @@ abstract class JsonApiAction implements ActionInterface
return new Response($data, $status);
}
protected function route($name, array $parameters = [])
{
/** @var \Flarum\Http\UrlGeneratorInterface $generator */
$generator = app('Flarum\Http\UrlGeneratorInterface');
return $generator->toRoute($name, $parameters);
}
/**
* Handle an API request and return an API response.
*