livewire / volt

Volt is an elegantly crafted functional API for Livewire.
https://livewire.laravel.com/docs/volt
MIT License
327 stars 19 forks source link

[1.x] Adds `Volt::route` #22

Closed nunomaduro closed 1 year ago

nunomaduro commented 1 year ago

Documentation: https://github.com/livewire/livewire/pull/6246.

This pull request the Volt::route method, that allows to define Volt routes in your routes file like so:

Route::get('/posts/create', CreatePost::class); // Regular Livewire component...

Volt::route('/posts/create', 'posts.create'); // Volt component...

Note that this feature offers feature parity with "Full-page components" on Livewire. However, because in Volt, regular classes are anonymous classes, we need to refer to those components using their names.