/**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     // Scaffolding should always begin with the singular
     // form of the now.
     $this->model = Pluralizer::singular($this->argument('name'));
     $this->fields = $this->option('fields');
     if (is_null($this->fields)) {
         throw new MissingFieldsException('You must specify the fields option.');
     }
     // We're going to need access to these values
     // within future commands. I'll save them
     // to temporary files to allow for that.
     $this->cache->fields($this->fields);
     $this->cache->modelName($this->model);
     $this->generateModel();
     $this->generateController();
     $this->generateViews();
     $this->generateMigration();
     $this->generateSeed();
     if (get_called_class() === 'Way\\Generators\\Commands\\ScaffoldGeneratorCommand') {
         $this->generateTest();
     }
     $this->generator->updateRoutesFile($this->model);
     $this->info('Updated ' . app_path() . '/routes.php');
     // We're all finished, so we
     // can delete the cache.
     $this->cache->destroyAll();
 }