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

Refactor AddsIncludesToQuery trait to add default includes handling #970

Closed
wants to merge 3 commits into from
Closed

Conversation

inmass
Copy link

@inmass inmass commented Sep 18, 2024

Add defaultIncludes functionality to AddsIncludesToQuery trait

  • Implement new defaultIncludes method to support automatic inclusion of relationships
  • Add support for default include of 'primaryImage' relationship

This commit introduces the ability to specify default includes in the query builder,
which was not previously available. The new functionality allows certain relationships
to be automatically included in every query without explicitly requesting them.

Key changes:

  1. New defaultIncludes method added to set default includes
  2. Updated findInclude method to consider both allowed and default includes
  3. Modified addIncludesToQuery to handle default includes

Example usage:
$query->defaultIncludes(['primaryImage'])

This addition enhances the flexibility of the query builder by allowing
automatic inclusion of critical relationships, improving ease of use and
reducing the need for repetitive include requests.

@inmass inmass closed this Sep 23, 2024
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