-
Notifications
You must be signed in to change notification settings - Fork 11.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash when assign a String in redirectGuestsTo #50871
Comments
But this is valid, right? |
I think is correct, because in the line https://github.com/laravel/framework/blob/11.x/src/Illuminate/Foundation/Configuration/Middleware.php#L523, transform the string to function and the types of $guests are "callable|string" |
So what's the crash? and actual reproducing step? |
The docs make it pretty clear to use a callback with using routes: https://laravel.com/docs/11.x/authentication#redirecting-unauthenticated-users The string is for hardcoded URLs. I think it's not possible because the app hasn't fully booted yet for the route resolver (the reasoning for the required callback), but I am not entirely sure. |
This can only be a hardcoded path or a callback. Never a named route like in the example above because of the reasons @ahinkle listed. |
Laravel Version
11.1.1
PHP Version
8.3
Database Driver & Version
No response
Description
Crash when assign a String in redirectGuestsTo, but the app works when assign a function.
That is rare because in the line https://github.com/laravel/framework/blob/11.x/src/Illuminate/Foundation/Configuration/Middleware.php#L523 is configure to support string and function
Steps To Reproduce
I use Inertia and Redis, you only need assign a string in redirectGuestsTo
The text was updated successfully, but these errors were encountered: