laravel-scout-tntsearch-driver
laravel-scout-tntsearch-driver copied to clipboard
Problem with join query
Hi, I have 3 tables with the following structure :
posts (Post Model -> belongsToMany('App\Category')):
id title body
--------------------------
categories (Category Model -> belongsToMany('App\Post')):
id title
--------------------------
category_post
category_id post_id
My question is how can I write a query to search using multiple inputs? for example I wanna search for a post with the title of "Hello world" which belongs to categories with ids of (1 and 2).
Any help would be greatly appreciated