Skip to content
Advertisement

laravel get all rows using where statement

I want to get all row, but I have to use where statement.

This is my code:

JavaScript

I have to use a where statement. What should I write instead of Show all?

Advertisement

Answer

Use when:

JavaScript

when second parameter (closure) will execute only if the first parameter is a truish expression, in your case if the city value is not equal to all.


Updated

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