you dont need to take the ids of the related model. you can just use associate or attach methods to bind the relation. This is good because you can pipe the syntax. please check the documentation for details.
if you dont like that you can just use $model->id = $id; it will still work.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community