make()->each(function (Testimonial $testimonial, int $key) { $testimonial->picture = FileStorageHelper::storeFile($testimonial, new \SplFileInfo(\resource_path( '../database/factories/assets/testimonials/default-picture-292x417.png' ))); $testimonial->order = $key + 1; $testimonial->saveQuietly(); }); } }