N
N
NubasLol2019-04-25 12:09:35
Laravel
NubasLol, 2019-04-25 12:09:35

How to use Eloquent based raw expressions?

How is this request

select * from orders where orders.id in (select min(id) as id from "orders" where cost > 0);

Write it down like this:
Order::whereIn('id', Order::where(блаблаббла))

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
JhaoDa, 2019-04-25
@NubasLol

Order::whereIn('id', Order::selectRaw('MIN(id)')->where('cost', '>', 0));

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question