Open njaciklum opened 3 years ago
In Laravel although we can create model for pivot table but Laravel doesn't count it in best practices.
I can see you have a model for pivot table 'ProductSize', eliminate it and use Product and Size to achieve the same results.
For reference please take a look at https://laravel.com/docs/8.x/eloquent-relationships#filtering-queries-via-intermediate-table-columns
In Laravel although we can create model for pivot table but Laravel doesn't count it in best practices.
I can see you have a model for pivot table 'ProductSize', eliminate it and use Product and Size to achieve the same results.
For reference please take a look at https://laravel.com/docs/8.x/eloquent-relationships#filtering-queries-via-intermediate-table-columns