Skip to content

Commit f77539e

Browse files
Merge pull request dingo#1641 from specialtactics/feature/add-route-url-generstor-to-api-facade
Adds a URL generator function "route" to API facade
2 parents b5a1c9b + 08b0817 commit f77539e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/Facade/API.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,17 @@ public static function router()
9191
{
9292
return static::$app['api.router'];
9393
}
94+
95+
/**
96+
* Get the API route of the given name, and optionally specify the API version.
97+
*
98+
* @param string $routeName
99+
* @param string $apiVersion
100+
*
101+
* @return string
102+
*/
103+
public static function route($routeName, $apiVersion = 'v1')
104+
{
105+
return static::$app['api.url']->version($apiVersion)->route($routeName);
106+
}
94107
}

0 commit comments

Comments
 (0)