laravel / folio

Page based routing for Laravel.
MIT License
568 stars 46 forks source link

[1.x] Adds `Folio::domain` #62

Closed nunomaduro closed 1 year ago

nunomaduro commented 1 year ago

This pull request closes https://github.com/laravel/folio/issues/56, and it adds the Folio::domain method, which allows scoping Folio's routes like so:

Folio::domain('{account}.example.com')->path(resource_path('views/pages'));

And, of course, in the example on top, the $account is available as a regular view variable. In addition, you can now create routes very similarly to what you do with Laravel's router.

Folio::path(resource_path('views/pages'));
Folio::path(resource_path('views/pages'))->middleware(...);
Folio::domain(...)->path(resource_path('views/pages'))->uri(...);