This pull request fixes three things when using the route() function and adds versioning to the cache generated by Folio's routes:
Extra parameters sent as the second parameter to the route() function are now sent as query parameters, just like the regular behavior of the route() function.
// before:
route('posts', ['page' => 1], false); // /posts
// with this pr:
route('posts', ['page' => 1], false); // /posts?page=1
The base URI of the mounted path is now respected. For example, Folio::uri('/1')->path(...) will generate a URL that contains that URI.
The domain of the Folio's mount is now respected, similar to the regular behavior of the route() function. For example, Folio::domain('podcasts.com')->... will generate a route() result with the http://podcasts.com/{...} domain.
Finally, versioning is introduced to the cache. This means that if FolioRoutes::version changes, the cached version is ignored until a new route:cache command is invoked.
Fixes https://github.com/laravel/folio/issues/85.
This pull request fixes three things when using the
route()
function and adds versioning to the cache generated by Folio's routes:route()
function are now sent as query parameters, just like the regular behavior of theroute()
function.Folio::uri('/1')->path(...)
will generate a URL that contains that URI.route()
function. For example,Folio::domain('podcasts.com')->...
will generate aroute()
result with thehttp://podcasts.com/{...}
domain.FolioRoutes::version
changes, the cached version is ignored until a newroute:cache
command is invoked.