jake balba jake balba - 3 months ago 33
PHP Question

How to add multiple where clause on Eloquent ORM Laravel?

Having a hard time here trying to retrieve specific records where I need the ID and the Date to match, here is my code:

$testq= DB::table('attendances')->where('user_id', '=', $userinput && 'logon', '=', $newdate)->get();


Just add one more where.

$testq= DB::table('attendances')
    ->where('user_id', '=', $userinput)
    ->where('logon', '=', $newdate)


$this where(string $column, string $operator = null, mixed $value = null, string $boolean = 'and')

Add a basic where clause to the query.