Skip to content
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

Laravel 11 new generic types #266

Merged
merged 2 commits into from
Nov 4, 2024
Merged

Laravel 11 new generic types #266

merged 2 commits into from
Nov 4, 2024

Conversation

GeniJaho
Copy link
Collaborator

Relates to #263.

  • Makes the rule as non-configurable, as before, so users won't need to change their configurations.
  • The check for the Laravel version is done within the rule, using Reflection, and checking the VERSION const of the Laravel Application class. Should we refactor this functionality into a class of its own, or wait for when we reach for it on future rules?
  • I've used the Laravel Container's when-needs-give capabilities to provide an optional Application class for testing the two versions.
  • I'm not sure if there is any performance penalty for doing that check on every model relationship. I don't think there is any significant penalty, but it's still something to remember.

Is there a better way to do this @peterfox?

@canvural
Copy link
Contributor

I tested it in a project and it works great 👍🏽

@GeniJaho GeniJaho merged commit 65c14c5 into main Nov 4, 2024
5 checks passed
@GeniJaho GeniJaho deleted the laravel-11-new-generic-types branch November 4, 2024 18:32
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.

2 participants