Second Dashboard page
Hi,
Its hard to understand the routing for /dashboard. Wanted to introduce a /dashboard2 or second page. Whats the best practice for getting another page like dashboard. Want to show/link it with sidebar menu (blank theme).
Hey!
Wave uses Volt and Folio under the hood, so routing is handled automatically based on file structure in your theme.
If you want to add a second page like /dashboard2
, just create a new file here:
resources/themes/[your-theme]/pages/dashboard2/index.blade.php
Take a look at the /resources/themes/anchor/pages/dashboard/index.blade.php
file as an example.
Folio will automatically register the route for you. Then, to show it in the sidebar, edit:
resources/themes/[your-theme]/components/app/sidebar.blade.php
Add a new item pointing to /dashboard2
or route('dashboard2')
.
No manual route definitions needed, Folio does the routing for you. If you want to dive deeper into how that works, here are the official docs:
- Folio (page-based routing): https://laravel.com/docs/12.x/folio
- Volt (Livewire components in Blade): https://livewire.laravel.com/docs/volt
Hope that this helps.
- Bobby
Thank you Bobby, implemented and worx! Wave is great!
No problem! Happy to hear that!