In Laravel, it is possible to have optional parameters on the route.
{token?}
How can I achieve this with a Livewire route?
Route::livewire(’/register/{token?}’, ‘auth.register’)->layout(‘layouts.app’)->name(‘auth.register’);
Users can register by themselves, if the app is set to invite only then I need to pass in the token to check if the invite is valid. I have looked at the official documentation but I couldn’t find anything. I might of missed something though.
Setting a default for $token using the mount method would work but I still have to pass something to the route.
/register/new