distinct in laravel 8

37

$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();

Comments

Submit
0 Comments