/** * Execute the console command. * * @return mixed */ public function handle() { $genres = $this->genreService->getAllGenres(); foreach ($genres as $genre) { Genre::updateOrCreate(['name' => $genre['name']], ['name' => $genre['name'], 'approved' => true]); } }