laravel query builder ?
$unique = $collection->unique(function ($item) {
return $item['brand'].$item['type'];
});
$unique->values()->all();
Have you tried $query->distinct(['brand', 'type'])?
https://stackoverflow.com/questions/12188027/
If you wanna use Eloquent you can implement it via "DB raw" but if you want use in mysql it self hust visit the link
Обсуждают сегодня