laravel select distinct code example
Example 1: select distinct laravel
$items = DB::table('item')->select('item_name')->distinct()->get();
Example 2: eloquent get distinct
$ad->getcodes()->distinct('pid')->count('pid');
Example 3: laravel wher in
$users = DB::table('users')
->whereIn('id', [1, 2, 3])
->get();
Example 4: laravel query json
$users = DB::table('users')
->whereJsonContains('options->languages', ['en', 'de'])
->get();