Caffeinated\Modules\Console\Commands\ModuleSeedCommand::fire PHP Method

fire() public method

Execute the console command.
public fire ( ) : mixed
return mixed
    public function fire()
    {
        $slug = $this->argument('slug');
        if (isset($slug)) {
            if (!$this->module->exists($slug)) {
                return $this->error('Module does not exist.');
            }
            if ($this->module->isEnabled($slug)) {
                $this->seed($slug);
            } elseif ($this->option('force')) {
                $this->seed($slug);
            }
            return;
        } else {
            if ($this->option('force')) {
                $modules = $this->module->all();
            } else {
                $modules = $this->module->enabled();
            }
            foreach ($modules as $module) {
                $this->seed($module['slug']);
            }
        }
    }