Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 2 years ago.
0

I am not sure, if this has been tried before, but I would do this with the 'whereRaw' method containing a subquery. http://dev.mysql.com/doc/refman/5.0/en/subqueries.html http://laravel.com/docs/4.2/eloquent

But I am also a Laravel newbie. It might also be (much more easily) possible with a series of the right query builder functions, i.e. something like this

$rows = MyModel::where('xxx', '>', 100)->count()->take(5)->where('yyy', '=', 'John Doe')->get();

The idea being that the first query builders count something and take only 5 results, and then you query it further...

Hope that helps and sorry for not being more specific.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

arctushar arctushar Joined 5 Oct 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.