Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel raw query join many to many

$query = DB::table('blog_posts')
->join('model_names_relations', 'blog_posts.id', '=', 'model_names_relations.blog_post_id')
->join('model_names', 'model_names.id', '=', 'model_names_relations.model_name_id')
->where('blog_posts.id', '12')
->get();
 
PREVIOUS NEXT
Tagged: #laravel #raw #query #join
ADD COMMENT
Topic
Name
1+9 =