public function fire() { $name = $this->argument('name'); $group = Group::where('name', '=', $name)->first(); if (is_null($group)) { $group = new Group(); $group->name = $name; try { $group->save(); } catch (\Exception $e) { $this->error($e->getMessage()); } $this->info("{$name} group added."); } else { $this->comment("{$name} group exists."); } }