make()->each(function (News $news) { $news->picture = FileStorageHelper::storeFile( $news, new \SplFileInfo(\resource_path( '../database/factories/assets/news/default-700x400.png' )) ); $news->thumbnail = FileStorageHelper::storeFile( $news, new \SplFileInfo(\resource_path( '../database/factories/assets/news/thumbnail-360x250.png' )) ); $news->saveQuietly(); }); } }