Register the macro by including it in a service provider's register
method.
For an example, to see how it works, let's imagine the following route definition:
Route::viewDir('/pages', 'pages');
And the following directory structure for the views:
views/
├── auth/
├── errors/
├── layouts/
├── pages/
│ ├── about-us.blade.php
│ ├── faq.blade.php
│ ├── privacy-policy.blade.php
│ ├── team/
│ │ ├── developers.blade.php
│ │ ├── index.blade.php
│ │ ├── management.blade.php
│ │ └── marketing.blade.php
│ └── terms-of-service.blade.php
└── partials/
The following routes will be generated to match each of the views in the given directory:
/pages/about-us
/pages/faq
/pages/privacy-policy
/pages/team
/pages/team/developers
/pages/team/management
/pages/team/marketing
/pages/terms-of-service