Skip to content

Commit

Permalink
Merge pull request #4 from HassanElZarkawy/bugfix/static_routes_were_…
Browse files Browse the repository at this point in the history
…shadowed_in_resource_and_apiResource

Fix Static route is shadowed by previously defined variable route
  • Loading branch information
Hassan El-Zarkawy authored Dec 10, 2021
2 parents 1e04287 + b527b5c commit fb779e1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Core/Http/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public static function resource(string $route, string $controller): RouteGroup
{
return self::group($route, function (RouteGroup $group) use ($controller) {
$group->get('/', [ $controller, 'index' ]);
$group->get('/{id}', [ $controller, 'show' ]);
$group->get('/show/{id}', [ $controller, 'show' ]);
$group->get('/create', [ $controller, 'create' ]);
$group->post('/create', [ $controller, 'store' ]);
$group->get('/edit/{id}', [ $controller, 'edit' ]);
Expand All @@ -126,7 +126,7 @@ public static function apiResource(string $route, string $controller): RouteGrou
{
return self::group($route, function (RouteGroup $group) use ($controller) {
$group->get('/', [ $controller, 'index' ]);
$group->get('/{id}', [ $controller, 'show' ]);
$group->get('/show/{id}', [ $controller, 'show' ]);
$group->put('/create', [ $controller, 'store' ]);
$group->patch('/edit/{id}', [ $controller, 'update' ]);
$group->delete('/delete/{id}', [ $controller, 'destroy' ]);
Expand Down

0 comments on commit fb779e1

Please sign in to comment.