@@ -33,12 +33,12 @@ discard block |
||
33 | 33 | $factory = new ResponseFactory(); |
34 | 34 | $strategy = new JsonStrategy($factory); |
35 | 35 | $strategy->setContainer($c); |
36 | - $group = $this->group('/api', function (RouteGroup $route) use ($controllerClass, $urlSlug) { |
|
37 | - $route->map('GET', '/' . $urlSlug, [$controllerClass, 'index']); |
|
38 | - $route->map('POST', '/' . $urlSlug, [$controllerClass, 'create']); |
|
39 | - $route->map('GET', '/' . $urlSlug . '/{id}', [$controllerClass, 'read']); |
|
40 | - $route->map('PATCH', '/' . $urlSlug . '/{id}', [$controllerClass, 'update']); |
|
41 | - $route->map('DELETE', '/' . $urlSlug . '/{id}', [$controllerClass, 'delete']); |
|
36 | + $group = $this->group('/api', function(RouteGroup $route) use ($controllerClass, $urlSlug) { |
|
37 | + $route->map('GET', '/'.$urlSlug, [$controllerClass, 'index']); |
|
38 | + $route->map('POST', '/'.$urlSlug, [$controllerClass, 'create']); |
|
39 | + $route->map('GET', '/'.$urlSlug.'/{id}', [$controllerClass, 'read']); |
|
40 | + $route->map('PATCH', '/'.$urlSlug.'/{id}', [$controllerClass, 'update']); |
|
41 | + $route->map('DELETE', '/'.$urlSlug.'/{id}', [$controllerClass, 'delete']); |
|
42 | 42 | }); |
43 | 43 | $group->setStrategy($strategy); |
44 | 44 | $group->middlewares([new JsonParse()]); |
@@ -51,21 +51,21 @@ discard block |
||
51 | 51 | $factory = new ResponseFactory(); |
52 | 52 | $strategy = new JsonStrategy($factory); |
53 | 53 | $strategy->setContainer($c); |
54 | - $group = $this->group('/admin', function (RouteGroup $route) use ($controllerClass, $urlSlug) { |
|
55 | - $route->map('GET', '/' . $urlSlug, [$controllerClass, 'index']); |
|
56 | - $route->map('POST', '/' . $urlSlug, [$controllerClass, 'create']); |
|
57 | - $route->map('GET', '/' . $urlSlug . '/{id}', [$controllerClass, 'read']); |
|
58 | - $route->map('PATCH', '/' . $urlSlug . '/{id}', [$controllerClass, 'update']); |
|
59 | - $route->map('DELETE', '/' . $urlSlug . '/{id}', [$controllerClass, 'delete']); |
|
54 | + $group = $this->group('/admin', function(RouteGroup $route) use ($controllerClass, $urlSlug) { |
|
55 | + $route->map('GET', '/'.$urlSlug, [$controllerClass, 'index']); |
|
56 | + $route->map('POST', '/'.$urlSlug, [$controllerClass, 'create']); |
|
57 | + $route->map('GET', '/'.$urlSlug.'/{id}', [$controllerClass, 'read']); |
|
58 | + $route->map('PATCH', '/'.$urlSlug.'/{id}', [$controllerClass, 'update']); |
|
59 | + $route->map('DELETE', '/'.$urlSlug.'/{id}', [$controllerClass, 'delete']); |
|
60 | 60 | |
61 | - $route->map('GET', '/' . $urlSlug, [$controllerClass, 'index']); |
|
62 | - $route->map('GET', '/' . $urlSlug . '/create', [$controllerClass, 'create']); |
|
63 | - $route->map('GET', '/' . $urlSlug . '/{id}', [$controllerClass, 'view']); |
|
64 | - $route->map('GET', '/' . $urlSlug . '/{id}/delete', [$controllerClass, 'delete']); |
|
65 | - $route->map('GET', '/' . $urlSlug . '/{id}/edit', [$controllerClass, 'edit']); |
|
66 | - $route->map('POST', '/' . $urlSlug . '/create', [$controllerClass, 'create']); |
|
67 | - $route->map('POST', '/' . $urlSlug . '/{id}/delete', [$controllerClass, 'delete']); |
|
68 | - $route->map('POST', '/' . $urlSlug . '/{id}/edit', [$controllerClass, 'edit']); |
|
61 | + $route->map('GET', '/'.$urlSlug, [$controllerClass, 'index']); |
|
62 | + $route->map('GET', '/'.$urlSlug.'/create', [$controllerClass, 'create']); |
|
63 | + $route->map('GET', '/'.$urlSlug.'/{id}', [$controllerClass, 'view']); |
|
64 | + $route->map('GET', '/'.$urlSlug.'/{id}/delete', [$controllerClass, 'delete']); |
|
65 | + $route->map('GET', '/'.$urlSlug.'/{id}/edit', [$controllerClass, 'edit']); |
|
66 | + $route->map('POST', '/'.$urlSlug.'/create', [$controllerClass, 'create']); |
|
67 | + $route->map('POST', '/'.$urlSlug.'/{id}/delete', [$controllerClass, 'delete']); |
|
68 | + $route->map('POST', '/'.$urlSlug.'/{id}/edit', [$controllerClass, 'edit']); |
|
69 | 69 | }); |
70 | 70 | |
71 | 71 | return $group; |