Skip to content

Commit 446bab2

Browse files
authored
Merge pull request dingo#1314 from denpamusic/master
Laravel 5.4 Illuminate/Routing/Route class changes.
2 parents 9427f5c + 8d3aee0 commit 446bab2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Routing/Adapter/Laravel.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
use Illuminate\Http\Request;
66
use Illuminate\Routing\Route;
77
use Illuminate\Routing\Router;
8-
use Illuminate\Routing\RouteCollection;
98
use Dingo\Api\Contract\Routing\Adapter;
9+
use Illuminate\Routing\RouteCollection;
1010
use Dingo\Api\Exception\UnknownVersionException;
1111

1212
class Laravel implements Adapter
@@ -119,6 +119,10 @@ protected function mergeOldRoutes($version)
119119
*/
120120
public function getRouteProperties($route, Request $request)
121121
{
122+
if (method_exists($route, 'uri') && method_exists($route, 'methods')) {
123+
return [$route->uri(), $route->methods(), $route->getAction()];
124+
}
125+
122126
return [$route->getUri(), $route->getMethods(), $route->getAction()];
123127
}
124128

0 commit comments

Comments
 (0)