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

How can I solve "laravel/horizon v1.1.0 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system"? - development

CORS issue between web/android/ios

Angular.js ng-click with mouse middle button