I was searching for making a GROUP BY name Eloquent ORM docs but I haven\'t find anything, neither on google.
GROUP BY name
Does anyone know if it\'s possible ? or sh
This is working for me (i use laravel 5.6).
$collection = MyModel::all()->groupBy('column');
If you want to convert the collection to plain php array, you can use toArray()
$array = MyModel::all()->groupBy('column')->toArray();