public function newDistribution($game) { $game = Game::where('name', $game)->orderBy('id', 'desc')->first(); $distributionService = new DistributionService(); $words = $distributionService->getRandom25Words(); $dist = new Distribution(); $dist->words = json_encode($words); $dist->save(); $game->distribution_id = $dist->id; $game->save(); return $words; }