-
Notifications
You must be signed in to change notification settings - Fork 11.5k
Description
Laravel Version
12.26.4
PHP Version
8.4
Database Driver & Version
No response
Description
I use to_route
in Livewire components, with the new return type this no longer works.
to_route(): Return value must be of type Illuminate\Http\RedirectResponse, Livewire\Features\SupportRedirects\Redirector returned
Change was:
function to_route($route, $parameters = [], $status = 302, $headers = []): RedirectResponse |
from 6d5dfad
@calebdw You just took it from the PHPDoc and "promoted" it to a return type, I assume?
I'll switch to Livewire $this->redirectRoute()
, probably cleaner anyway, but since https://livewire.laravel.com/docs/redirecting mentions:
If you prefer, you can use Laravel's built-in redirect utilities within your components as well.
I thought I'd at least create this issue so someone else with the same problem can find something.
I'm not sure how Livewire handles these but it definitely worked before.
Thanks!
Steps To Reproduce
use to_route() in a Livewire component.