public function generate(Collection $collection, DomainLanguages $lang): stdclass 	{ 		$tables = new stdClass;  		$lang = $lang->value;  		$collection->groupBy(function (Leaderboard $item) { 			return $item->getRawOriginal('type'); 		}) 		->each(function (Collection $item, $key) use (&$tables, $lang) { 			$item->when($key == LeaderboardType::CompanySize->value, function (Collection $item) use (&$tables) { 				$item->groupBy(function (Leaderboard $item) { 					return $item->getRawOriginal('company_size'); 				}) 				->each(function (Collection $item, $key) use (&$tables) { 					$tables->company_size[$key] = $item; 				}); 			});  			$item->when($key == LeaderboardType::Industry->value, function (Collection $item) use (&$tables, $lang) { 				$item->groupBy(function (Leaderboard $item) use ($lang) { 					return $item->getTranslation('industry', $lang); 				}) 				->each(function (Collection $item, $key) use (&$tables) { 					$tables->industries[$key] = $item; 				}); 			});  			$item->when($key == LeaderboardType::NewEntry->value, function (Collection $item) use (&$tables) { 				$tables->newEntry = $item->first(); 			});  			$item->when($key == LeaderboardType::BestOfTheBest->value, function (Collection $item) use (&$tables) { 				$tables->best = $item->first(); 			}); 		});  		return $tables; 	}