/** * @param InputInterface $input * @param OutputInterface $output */ protected function execute(InputInterface $input, OutputInterface $output) { $group = $input->getOption('title'); if (!$group) { $output->writeln('<fg=red>You must provide a title for your command</>'); return; } $check = WatchlistGroup::where('title', $group)->first(); if ($check) { $output->writeln('<fg=yellow>A group with this name already exists</>'); return; } $watchListGroup = new WatchlistGroup(); $watchListGroup->title = $group; $watchListGroup->save(); $output->writeln('<fg=green>Success! Group with the title of ' . $group . ' created successfully!</>'); }