Skip to content
Advertisement

where and orwhere is not working on eloquent

JavaScript

Here both where and orWhere are not working in eloquent says Bad Method call. can anyone help me with this?

Advertisement

Answer

$classes is currently a Collection, not a QueryBuilder object. Add the full query to the if block and move the default to an else, like this:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement