pluck('name', 'id')->all(); $regionChoice = $this->choice( 'For which region do you want to add the seed?', $regions ); $url = $this->ask('Please input the seed url'); if(!str_contains($url, 'e-domizil.ch')){ $this->error('Given seed url is not valid.'); }else{ $seed = Seed::create([ 'uri' => $url, 'region_id' => array_search($regionChoice, $regions) ]); $this->info('New Seed has been added: '.$seed); } } }