Sélectionnez Laravel distinct
$items = DB::table('item')->select('item_name')->distinct()->get();
NachooCh
$items = DB::table('item')->select('item_name')->distinct()->get();
$ad->getcodes()->distinct('pid')->count('pid');
use Illuminate\Support\Facades\DB;
$users = DB::table('users')
->join('contacts', 'users.id', '=', 'contacts.user_id')
->join('orders', 'users.id', '=', 'orders.user_id')
->select('users.*', 'contacts.phone', 'orders.price')
->get();