/** * Fire off the handler. * * @param \Illuminate\Console\Command $console * @param string $slug * @param string $class * @return bool */ public function fire(Command $console, $slug, $class) { $this->console = $console; $this->moduleName = studly_case($slug); $this->className = studly_case($class); if ($this->module->exists($this->moduleName)) { $this->makeFile(); return $this->console->info("Created Module Controller: [{$this->moduleName}] " . $this->getFilename()); } return $this->console->info("Module [{$this->moduleName}] does not exist."); }
/** * Fire off the handler. * * @param \Illuminate\Console\Command $console * @param string $slug * @param string $class * @return bool */ public function fire(Command $console, $slug, $name, $type) { $this->console = $console; $this->moduleName = studly_case($slug); $this->emailName = snake_case($name); $this->type = $type; if ($this->module->exists($this->moduleName)) { $this->makeFile(); return $this->console->info("Created Module Email View: [{$this->moduleName}] " . $this->getFilename()); } return $this->console->info("Module [{$this->moduleName}] does not exist."); }
/** * Fire off the handler. * * @param \C5\AppKit\Console\ModuleMakeMigrationCommand $console * @param string $slug * @return string */ public function fire(Command $console, $slug, $table) { $this->console = $console; $this->moduleName = studly_case($slug); $this->table = str_plural(strtolower($table)); $this->model = str_singular(studly_case($table)); $this->migrationName = 'create_' . snake_case($this->table) . '_table'; $this->className = studly_case($this->migrationName); if ($this->module->exists($this->moduleName)) { $this->makeMigration(); $this->makeModel(); $this->console->info("Created Module Migration: [{$this->moduleName}] " . $this->getFilename()); return exec('composer dump-autoload'); } return $this->console->info("Module [{$this->moduleName}] does not exist."); }
/** * Execute the console command. * * @return mixed */ public function fire() { $module = $this->argument('module'); $moduleName = studly_case($module); if (isset($module)) { if ($this->module->exists($moduleName)) { $this->seed($module); return; } return $this->error("Module [{$moduleName}] does not exist."); } else { foreach ($this->module->all() as $module) { $this->seed($module['slug']); } } }
/** * Fire off the handler. * * @param \C5\AppKit\Console\ModuleMakeCommand $console * @param string $slug * @return bool */ public function fire(Command $console, $slug, $blank = false) { $this->console = $console; $this->slug = $slug; $this->name = strtolower($slug); $this->blank = $blank; if ($this->module->exists($this->slug)) { $console->comment('Module [{$this->name}] already exists.'); return false; } $this->generate($console); }
/** * Run migrations for the specified module. * * @param string $slug * @return mixed */ protected function migrate($slug) { $moduleName = studly_case($slug); if ($this->module->exists($moduleName)) { $pretend = $this->option('pretend'); $path = $this->getMigrationPath($slug); $this->migrator->run($path, $pretend); // Once the migrator has run we will grab the note output and send it out to // the console screen, since the migrator itself functions without having // any instances of the OutputInterface contract passed into the class. foreach ($this->migrator->getNotes() as $note) { $this->output->writeln($note); } // Finally, if the "seed" option has been given, we will re-run the database // seed task to re-populate the database, which is convenient when adding // a migration and a seed at the same time, as it is only this command. if ($this->option('seed')) { $this->call('appkit:seed:module', ['module' => $slug, '--force']); } } else { return $this->error("Module [{$moduleName}] does not exist."); } }