Routing and presentation discovery
- Registering presentations
- Route names
- Nested presentations
- Presentation discovery
- Path normalization
Registering presentations
SlideWire registers a Route::slidewire() macro. This macro creates the Livewire route that renders a presentation deck and stores the presentation key in the route defaults.
use Illuminate\Support\Facades\Route;
Route::slidewire('/slides/demo', 'demo/showcase');
If the presentation cannot be resolved, the deck route returns a 404 response.
Route names
Route names are generated from the presentation key:
Route::slidewire('/slides/demo', 'demo/showcase');
// slidewire.demo.showcase
This applies to nested keys as well.
Nested presentations
Nested presentation keys are supported out of the box:
Route::slidewire('/slides/q1', 'sales/q1-launch');
Route::slidewire('/slides/retro', 'engineering/retro/sprint-42');
These routes resolve to presentation sources inside the configured presentation roots.
Presentation discovery
Presentation sources are discovered from the directories listed in config/slidewire.php:
'presentation_roots' => [
resource_path('views/pages/slides'),
],
When SlideWire resolves a presentation, it checks each root in this order:
{presentation}.blade.php{presentation}.md{presentation}/
For example, the key team/q1-kickoff may resolve to any of these:
resources/views/pages/slides/team/q1-kickoff.blade.php
resources/views/pages/slides/team/q1-kickoff.md
resources/views/pages/slides/team/q1-kickoff/
If both a Blade file and a Markdown file exist for the same key, SlideWire keeps the Blade file as the source of truth.
Path normalization
Presentation keys are normalized before lookup:
- leading and trailing slashes are trimmed
- backslashes are converted to forward slashes
..segments are stripped
This allows keys from different sources to resolve consistently while avoiding directory traversal issues.