Skip to content

Commit

Permalink
Merge pull request #1641 from specialtactics/feature/add-route-url-ge…
Browse files Browse the repository at this point in the history
…nerstor-to-api-facade

Adds a URL generator function "route" to API facade
  • Loading branch information
specialtactics authored Mar 24, 2019
2 parents b5a1c9b + 08b0817 commit f77539e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Facade/API.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,17 @@ public static function router()
{
return static::$app['api.router'];
}

/**
* Get the API route of the given name, and optionally specify the API version.
*
* @param string $routeName
* @param string $apiVersion
*
* @return string
*/
public static function route($routeName, $apiVersion = 'v1')
{
return static::$app['api.url']->version($apiVersion)->route($routeName);
}
}

0 comments on commit f77539e

Please sign in to comment.