Skip to content

Conversation

phadaphunk
Copy link
Contributor

@phadaphunk phadaphunk commented Aug 26, 2025

The newly added strict types are causing issues with popular packages like jwt-auth since the custom Guard implements the Guard contract (parent).

I feel the return type is too strict. I don't think the return type should be mixed but shouldn't it at least be Guard and not StatefulGuard. This way custom guard implementations are not breaking.

With 11.5k ⭐ on jwt-auth, I'm surprised no one got this issue today.

image

@phadaphunk phadaphunk changed the title fix: base class guard in return types fix: base class guard in return types is breaking custom guards Aug 26, 2025
@cbaconnier
Copy link
Contributor

Related issue #56783

@rodrigopedra
Copy link
Contributor

At this point, isn't it better to revert #56684 altogether?

@phadaphunk
Copy link
Contributor Author

@rodrigopedra I don't think the typing is bad, but some of them definitely needed a bit more attention.

@rodrigopedra
Copy link
Contributor

I also don't think it's bad.

But it seems better, due to the repeated issues since its release, to target it to master and ask the community to review it extensively before releasing those changes.

@taylorotwell taylorotwell merged commit aef19cd into laravel:12.x Aug 27, 2025
80 of 101 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants