/** * Execute the console command. * * @return mixed */ public function fire() { $name = $this->argument('name'); $text = $this->argument('text'); $createCategory = $this->notifynderCategory->add($name, $text); if (!$createCategory) { $this->error('The category has been not created'); return false; } $this->info("Category {$createCategory->name} has been created"); }
/** * Execute the console command. * * @return mixed */ public function fire() { $identifier = $this->argument('identifier'); if ($this->isIntegerValue($identifier)) { $delete = $this->notifynderCategory->delete($identifier); } else { $delete = $this->notifynderCategory->deleteByName($identifier); } if (!$delete) { $this->error('Category Not found'); return false; } $this->info('Category has been deleted'); }