Support the ongoing development of →
Database Eloquent
Last updated 4 months ago.

What win32 application? Can you show the table structures and table names?


It is a win32 application from a friend. I develop a small web application which is able to show the data with some nice graphics and stuff. The table is called "bookings" and has some basic columns like 'id', 'productcode' and the 'productname'. A booking is ´basically an action like selling something.

Imagine this structure:

Now I want to retrieve all products ('PRODUCTNAME') and count which off them is selled the most.

Last updated 7 years ago.

I'm not 100% sure, but I believe you need a model. But could you use a combination of grouping and then paginate only 10 for the results.
Some code from the docs:

$users = DB::table('users')
                    ->orderBy('name', 'desc')
                    ->having('count', '>', 100)

And learn how to use the skip and take in query builder.

$users = DB::table('users')->skip(0)->take(10)->get();

Read over the query builder docs. Also see if this helps:

Last updated 7 years ago.

Sign in to participate in this thread!


Your banner here too?

LukasMa lukasma Joined 26 Nov 2014


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

Your logo here?

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

© 2022 - All rights reserved.