What is the best practice to setup many to many relationship with post and categories in laravel eloquent? Do I create a separate model for pivot table?
To define this relationship, three database tables are needed: post, category, and category_post. The category_post table is derived from the alphabetical order of the related model names, and contains the category_id and post_id columns.