make()->each(function (Testimonial $testimonial) use ($type) { $testimonial->type = $type; $testimonial->picture = FileStorageHelper::storeFile( new Testimonial(), new \SplFileInfo(\resource_path( '../database/factories/assets/testimonials/default-picture-100x100.png' )) ); $testimonial->save(); }); } } }