Skip to content

feat(ModelsCommand): add configuration option to disable model query methods #1692

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

pataar
Copy link
Contributor

@pataar pataar commented Mar 31, 2025

Summary

Introduced a new configuration option write_query_methods in config/ide-helper.php.
This controls whether the query(), newQuery(), and newModelQuery() methods are generated.

Since Laravel 11.15, these methods are properly typed in the framework itself, making IDE-helper’s versions largely redundant.
Overriding them may even lead to inconsistencies, so relying on the framework is likely safer.

However, disabling them by default felt too intrusive, so this setting is opt-in for now.

image
⬆ This is without the generated query() method, but using the generic query() from the framework.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Misc. change (internal, infrastructure, maintenance, etc.)

Checklist

  • Existing tests have been adapted and/or new tests have been added
  • Update the README.md
  • Code style has been fixed via composer fix-style

@pataar pataar force-pushed the add_configurable_query_methods branch from b8cb502 to a3fa302 Compare April 11, 2025 12:07
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.

1 participant