Maybe do this:
Model::select('column->property as field')
->...
->groupBy('field');
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi there,
me again ;-). Can I make an eloquent query to group by a json column property like:
Model::get()->groupBy('column->property')
? Does not seem to work, but maybe it does not work at all?
Cheers
Chris
Maybe do this:
Model::select('column->property as field')
->...
->groupBy('field');
Please or to participate in this conversation.