how to count all distinct values in sql joint laravel 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');