1 | <?php |
||
7 | class DingoGenerator extends AbstractGenerator |
||
8 | { |
||
9 | /** |
||
10 | * @param \Illuminate\Routing\Route $route |
||
11 | * @param array $bindings |
||
12 | * @param bool $withResponse |
||
13 | * |
||
14 | * @return array |
||
15 | */ |
||
16 | public function processRoute($route, $bindings = [], $withResponse = true) |
||
17 | { |
||
18 | $response = ''; |
||
19 | |||
20 | if ($withResponse) { |
||
21 | try { |
||
22 | $response = $this->getRouteResponse($route, $bindings); |
||
23 | } catch (Exception $e) {} |
||
|
|||
24 | } |
||
25 | |||
26 | $routeAction = $route->getAction(); |
||
27 | $routeGroup = $this->getRouteGroup($routeAction['uses']); |
||
28 | $routeDescription = $this->getRouteDescription($routeAction['uses']); |
||
29 | |||
30 | return $this->getParameters([ |
||
31 | 'resource' => $routeGroup, |
||
32 | 'title' => $routeDescription['short'], |
||
33 | 'description' => $routeDescription['long'], |
||
34 | 'methods' => $route->getMethods(), |
||
35 | 'uri' => $route->uri(), |
||
36 | 'parameters' => [], |
||
37 | 'response' => $response, |
||
38 | ], $routeAction); |
||
39 | } |
||
40 | |||
41 | /** |
||
42 | * {@inheritdoc} |
||
43 | */ |
||
44 | public function callRoute($method, $uri, $parameters = [], $cookies = [], $files = [], $server = [], $content = null) |
||
48 | |||
49 | /** |
||
50 | * {@inheritdoc} |
||
51 | */ |
||
52 | protected function getUri($route) |
||
56 | } |
||
57 |