Answer the question
In order to leave comments, you need to log in
How to add extra field to select using ORM?
Laravel 4.2.17
I want to add an additional field 'min(price) as price' when searching records through ORM. Creating a search: Apartment::active();
Tried like this:
Apartment::active()->addSelect('min(price) as price');
Apartment::active()->SelectRaw('min(price) as price');
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question