-1
I have a query and I need to turn it into lavarel code.
I have no idea how to do it.
select DISTINCT (
SELECT distinct
products.name
FROM
products
join topics on topics.product_id = products.id ) AS product
from
contents
join content_topics on content_topics.content_id = contents.id
join topics b on b.id = content_topics.topic_id
where contents.id = 778;
This content.id will be $request->id
public function listProduct(Request $request){
if(isset($request->id)){
$data = ??
}
}
Gabriel from which table is from, content or products?
– Glenys Mitchell
From the table Contents
– gabrielfalieri
Have you ever run this query in the bank? it worked?
– Glenys Mitchell
yes, this query works
– gabrielfalieri
I get it, I’ll edit my answer.
– Glenys Mitchell