select `media`.*, `media_product`.`product_id` as `pivot_product_id`, `media_product`.`media_id` as `pivot_media_id`, `media_product`.`created_at` as `pivot_created_at`, `media_product`.`updated_at` as `pivot_updated_at` from `media` innerjoin `media_product` on `media`.`id` = `media_product`.`media_id` where `media_product`.`product_id` in (818, 846, 852, 890)
select `categories`.*, `category_product`.`product_id` as `pivot_product_id`, `category_product`.`category_id` as `pivot_category_id`, `category_product`.`created_at` as `pivot_created_at`, `category_product`.`updated_at` as `pivot_updated_at` from `categories` innerjoin `category_product` on `categories`.`id` = `category_product`.`category_id` where `category_product`.`product_id` in (818, 846, 852, 890)