Tuesday, April 10, 2018

ORM – Many to Many vs belongs with properties of Model - development

ORM – Many to Many vs belongs with properties of Model

I am using Laravel’s ORM model (eloquent), yet this doesn’t relate only to Laravel.

I have a Recipe model and I would like to manipulate data on any other model that relates to Recipe, i.e. vitamins, product type, etc (in each recipe). At first I thought it’s classic belongsTo Recipe. Yet if, from the vitamins table, each Vitamin shows the range of volume it exists in each Recipe. By this design, doesn’t this mean that this relationship is ManyToMany?

Thanks, Bud



from Laravel Questions and Answers https://laravelquestions.com/laravel/orm-many-to-many-vs-belongs-with-properties-of-model/
via Lzo Media

No comments:

Post a Comment