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 an ORM query for a related object ("base"), which looks like this: $class::query()->related('base');
I want to add a condition in the query like so: ->where(\DB::expr('DATE(base.created)'), $date_variable), but because of the column and table aliasing in ORM, neither base nor created are recognized.
Ideally there would be a way to translate "base" and "created" into their aliases by using some method on the query object. Is this possible? If not, can it be added?
Thanks.
The text was updated successfully, but these errors were encountered:
The problem with this is that the aliases are generated when the sql is compiled, and if that query is created through the ORM the DB class does not have any knowledge of how relation names map to aliases.
I have an ORM query for a related object ("base"), which looks like this: $class::query()->related('base');
I want to add a condition in the query like so: ->where(\DB::expr('DATE(base.created)'), $date_variable), but because of the column and table aliasing in ORM, neither base nor created are recognized.
Ideally there would be a way to translate "base" and "created" into their aliases by using some method on the query object. Is this possible? If not, can it be added?
Thanks.
The text was updated successfully, but these errors were encountered: