C
C
cryp242019-06-12 20:56:51
Laravel
cryp24, 2019-06-12 20:56:51

Laravel where how to compose query correctly (not last floor)?

Roughly speaking, the table has two fields "apartment floor" and "house floor". How to make a request in Laravel in such a way to get records in which "the floor of apartments is from 0 to (the number of floors of the house -1)" The number of floors of the house can be different.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jazzus, 2019-06-12
@cryp24

Apart::whereColumn('floor', '<', 'floors')->get();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question