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

c - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -