Since I have had problems with the plunk()
method I have tried to find a way to translate this query to Eloquent, but until now I have not succeeded, is there any other way?
select distinct usuario_ad from usuarios;
Since I have had problems with the plunk()
method I have tried to find a way to translate this query to Eloquent, but until now I have not succeeded, is there any other way?
select distinct usuario_ad from usuarios;
Your query should occupy the distinct () method, but you can also use the raw () method to write the method in sql.
With Eloquent Laravel:
$data = User::select("usuario_ad")
->distinct()
->get();
Or with the query builder
$data = \DB::table("usuarios")
->select("usuario_ad")
->distinct()
->get();