make()->each(function (News $news, int $key) { $news->picture_thumbnail = FileStorageHelper::storeFile($news, new \SplFileInfo(\resource_path( '../database/factories/assets/news/default-picture-265x354.png' ))); $news->picture = FileStorageHelper::storeFile($news, new \SplFileInfo(\resource_path( '../database/factories/assets/news/default-picture-1002x565.png' ))); $news->order = $key + 1; $news->saveQuietly(); }); } }