Evercode1\ViewMaker\RemoveChart::handle PHP Method

handle() public method

Execute the console command.
public handle ( ) : mixed
return mixed
    public function handle()
    {
        $this->modelName = $this->formatModel($this->argument('ModelName'));
        $this->modelPath = $this->formatModelPath($this->argument('ModelName'));
        if (!$this->chartExists()) {
            $this->error('Error, can\'t find ' . $this->modelName . ' chart');
            die;
        }
        if ($this->removeChartFromFiles()) {
            $this->sendSuccessMessage();
            return;
        }
        $this->error('Oops, something went wrong!');
    }