In this article, We will explain to you how to use the Distinct Count query in laravel(laravel eloquent Distinct Count query example). here we will give you a simple example of laravel eloquent Distinct Count query. The laravel eloquent provides many types of eloquent methods. the Distinct Count method will return the int value.
Example
$students = DB::table('students')
->distinct('first_name')
->count('first_name');