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
While Eloquent doesn't handle returning a UNION from multiple models well (everything will be shoved into the first model's class), it does handle it well as a subselect with multiple models. It makes it much easier to scan across many different models as part of a very complex where.
The text was updated successfully, but these errors were encountered:
This request is to add a feature for SQL Unions.
Laravel Docs: Laravel Eloquent Unions
MySQL Docs: MySQL 8.1 UNION Clause
Union Example
Example SQL input:
Example Eloquent output:
Union All Example
Example SQL input:
Example Eloquent output:
Union with orderBy on id
Example SQL input:
Example Eloquent output:
Additional Context
While Eloquent doesn't handle returning a UNION from multiple models well (everything will be shoved into the first model's class), it does handle it well as a subselect with multiple models. It makes it much easier to scan across many different models as part of a very complex where.
The text was updated successfully, but these errors were encountered: