|
| 1 | +## Laravel Folio |
1 | 2 |
|
2 | | -- Laravel Folio is a file based router. With Laravel Folio, a new route is creatted for every Blade file within the correct directory. i.e. `Pages` are usually in in `resources/views/pages/` and the file structure determines routes: |
3 | | -- `pages/index.blade.php` → `/` |
4 | | -- `pages/profile/index.blade.php` → `/profile` |
5 | | -- `pages/auth/login.blade.php` → `/auth/login` |
6 | | -- List available Folio routes using `php artisan folio:list` or using Boost's `list-routes` tool. |
| 3 | +- Laravel Folio is a file based router. With Laravel Folio, a new route is created for every Blade file within the configured Folio directory. For example, pages are usually in in `resources/views/pages/` and the file structure determines routes: |
| 4 | + - `pages/index.blade.php` → `/` |
| 5 | + - `pages/profile/index.blade.php` → `/profile` |
| 6 | + - `pages/auth/login.blade.php` → `/auth/login` |
| 7 | +- You may list available Folio routes using `php artisan folio:list` or using Boost's `list-routes` tool. |
7 | 8 |
|
8 | | -### Folio: New pages & routes |
| 9 | +### New Pages & Routes |
9 | 10 | - Always create new `folio` pages and routes using `artisan folio:page [name]` following existing naming conventions. |
10 | 11 |
|
11 | 12 | @verbatim |
12 | | -<code-snippet name="Example folio:page commands for automatic routing" lang="shell"> |
| 13 | +<code-snippet name="Example folio:page Commands for Automatic Routing" lang="shell"> |
13 | 14 | // Creates: resources/views/pages/products.blade.php → /products |
14 | 15 | php artisan folio:page 'products' |
15 | 16 |
|
16 | | - |
17 | 17 | // Creates: resources/views/pages/products/[id].blade.php → /products/{id} |
18 | 18 | php artisan folio:page 'products/[id]' |
19 | 19 | </code-snippet> |
20 | 20 | @endverbatim |
21 | 21 |
|
22 | | -- Add a 'name' to each new Folio page at the very top of the file, so it has a named route available for other parts of the codebase to use. |
| 22 | +- Add a 'name' to each new Folio page at the very top of the file so it has a named route available for other parts of the codebase to use. |
| 23 | + |
23 | 24 | @verbatim |
24 | 25 | <code-snippet name="Adding named route to Folio page" lang="php"> |
25 | 26 | use function Laravel\Folio\name; |
|
28 | 29 | </code-snippet> |
29 | 30 | @endverbatim |
30 | 31 |
|
31 | | - |
32 | | -### Folio: Support & Docs |
| 32 | +### Support & Documentation |
33 | 33 | - Folio supports: middleware, serving pages from multiple paths, subdomain routing, named routes, nested routes, index routes, route parameters, and route model binding. |
34 | 34 | - If available, use Boost's `search-docs` tool to use Folio to its full potential and help the user effectively. |
35 | 35 |
|
36 | 36 | @verbatim |
37 | | -<code-snippet name="Folio middleware example" lang="php"> |
| 37 | +<code-snippet name="Folio Middleware Example" lang="php"> |
38 | 38 | use function Laravel\Folio\{name, middleware}; |
39 | 39 |
|
40 | 40 | name('admin.products'); |
|
0 commit comments