How to write Laravel eloquent query where (condition) and (condition2 or condition 3)

  eloquent, laravel, php, sql

Lets say we have SQL like this

select * from cards
where (deck_id=${deck_id})
and (added_by =${user_id} or is_available = 1)

And want to write in Laravel eloquent

I tried using the following queries but the result is not same as it suppose to be.



Source: Laravel

Leave a Reply