i have a function to show data with 3 where clause condition . but this output is invalid . i have 4 data and just show 1 . this function like this :
public function alkes_user()
{
$user_id = Auth::user()->id;
$unit = User::where('roles_id' , 1)->pluck('nama_unit', 'id');
$alat = Alat::with('users')
->where('jenis' ,'Alkes')
->where('user_id', $user_id)
->where('is_active', 'true')
->orderBy('created_at', 'desc')->paginate(10);
return view('users.alkes_user',['alat' => $alat , 'unit' => $unit ,'count' => $count ]);
}
this data only showing 1 , but in database i have so many data . what wrong and how to solve this ? thanks you