Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Romain's avatar
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

0 likes
0 replies

Please or to participate in this conversation.