Closed
Description
So I have a query such as this. and i have an api endpoint categories/id/products..
$collection = ProductVariant::with( 'product.owner' )->whereHas( 'product', function( $q ) use ( $categoryId )
{
$q->whereCategoryId($categoryId)->live();
} )->inRandomOrder()->live(1)
but when i change the id to say 2 or 3.. I get same products.. is this something I have to take care of? or am i doing something wrong?
Environment
Laravel Version: 5.6.2
Laravel Model Caching Package Version: ^0.2.22
PHP Version: * 7.1.6 *
Homestead Version: N/A (using Valet)
Operating System & Version: *Mac OS - El captain - 10.11.6 *