G
G
GaserV2017-08-28 23:26:52
Laravel
GaserV, 2017-08-28 23:26:52

Why does the condition not work correctly in the model?

Such a problem. The User model has a method that should return records that have a status field <3, or <=2.
It doesn't work like this (returns 0 records, although there should be several): And if so, then it works:
return $this->projects->where('status', '<', 3);
return $this->projects->where('status', 1);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GrimJack, 2017-08-28
@GrimJack

Do$this->projects->where('status', '<', 3)->get();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question