Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 1 year ago.
0

I believe that you can actually use some of the query builder functions through Eloquent querys.

I'd give something like this a try...

Product::with( 'urls','prices')->where('user_id', '=', $id)->min('cost')->get();

So long as there isn't a collision with the min column and another column within the Products or Urls table, this might work.

Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

PouleR pouler Joined 19 Mar 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.