Sep 13, 2020
0
Level 30
Create multiple entities
Hey,
upon saving a Show's Season, I want to enter the number of Episode in the Season (say 10) and I want the 10 Episode entities to be created. Can I achieve that with Nova?
I achieved it in the regular part of the site by doing:
$season->episodes()->createMany(
Collection::times($request->input('number_of_episodes'), function ($number) {
return ['number' => $number];
})
);
Which works exactly as I want, but how to do it with Nova?
Thanks
Please or to participate in this conversation.