You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have recently proposed a new feature to the QueryBuilder that I think could be useful.
The current join method in Laravel's QueryBuilder fetches all records, including soft-deleted records. This can be problematic when working with models that use soft-deletes, as soft-deleted records should not be included in joins.
To solve this issue, I proposed a new approach that checks if the table being joined is a model or not. If it is a model, we retrieve the table name and soft-delete field from the model and filter soft-deleted records automatically.
This new approach allows developers to use the existing join method but with the added benefit of automatically excluding soft-deleted records when joining models that use soft-deletes.
I hope this provides a clear explanation of the proposed feature
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone,
I have recently proposed a new feature to the QueryBuilder that I think could be useful.
The current join method in Laravel's QueryBuilder fetches all records, including soft-deleted records. This can be problematic when working with models that use soft-deletes, as soft-deleted records should not be included in joins.
To solve this issue, I proposed a new approach that checks if the table being joined is a model or not. If it is a model, we retrieve the table name and soft-delete field from the model and filter soft-deleted records automatically.
This new approach allows developers to use the existing join method but with the added benefit of automatically excluding soft-deleted records when joining models that use soft-deletes.
I hope this provides a clear explanation of the proposed feature
Beta Was this translation helpful? Give feedback.
All reactions