Support the ongoing development of Laravel.io →
Requests Database Eloquent
Last updated 2 years ago.
0
return Product::where('categories.id', $categoryId)->where('products.hidden', 0)
            ->leftJoin('products_in_categories', 'products_in_categories.prod_id', '=', 'products.id')
            ->leftJoin('categories', 'products_in_categories.cat_id', '=', 'categories.id')
            ->leftJoin('furnitures', 'products.furniture', '=', 'furnitures.id')
            ->paginate(10, array('products.*', 'categories.slug as cat_slug', 'furnitures.slug as furn_slug'));
Last updated 8 years ago.
0

can u do it like that .. then it's super cool!

0

Sign in to participate in this thread!

Eventy

Your banner here too?

graman graman Joined 29 May 2015

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.