Relative Content

Tag Archive for laraveleloquentormmodelmany-to-many

PHP Laravel Eloquent ORM. How to test table relantionship (belongsToMany)

I’m currently building an API assigned for an ecommerce project using Laravel framework. While getting help to build data migrations and Models, I got confused on how the product_categories, the intermediate table, can link a product and category as in the many to many relantionship (products <-> product_categories <-> category). These are the models in development:
project models