PHP Laravel: Update one -to- many relationship -


i have 1 many relationship in eloquent model , know best approach go updating model, belongsto model part.

i have come across other answers suggest save each belongsto model singly, brings problem making n amount of calls database server instead of single insert or few.

so know best approach ensure query , database resourse optimized , efficient.

hasone / hasmany (1-1, 1-m) 1. save(new or existing) 2. savemany(array of models new or existing)

use of these 2 methods..


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -