Nikola Ranisavljev
Nikola Ranisavljev

Reputation: 63

Laravel - How to get all columns if table is null or specific value

How can I get all data where "status" is "null" or "status" is "z" in one query?

Table columns: id, content, status

$pitanja = KartonPitanja::whereNull("pol")->where("pol","z")->get();

Upvotes: 1

Views: 269

Answers (1)

Sharad Mishra
Sharad Mishra

Reputation: 187

use orWhere like this

$pitanja = KartonPitanja::whereNull("pol")->orWhere("pol","z")->get();

Upvotes: 3

Related Questions