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

Comments

Popular posts from this blog

ng-show doesn’t work correct with value boolean

Using PHP and MySQL data to generate PDF letters like in MS Word mailmerge functionality - development

ng-include of inline SVG does not display gradient except in Chrome