Пример #1
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $module = str_studly($this->getStringArg('module'));
     if (!workbench()->has($module)) {
         workbench()->setUsed($module);
         $this->info("Module [{$module}] used successfully.");
     } else {
         $this->error("Module [{$module}] does not exists.");
     }
 }
Пример #2
0
 /**
  * Get studly file name
  *
  * @throws InvalidFileNameException
  *
  * @return string
  */
 protected function getFileName()
 {
     if (is_string($name = $this->argument('name'))) {
         return str_studly($name);
     }
     throw new InvalidFileNameException();
 }
Пример #3
0
 /**
  * Get the mutate form method name.
  *
  * @param  string  $key
  *
  * @return string
  */
 private function getMutateFromMethodName($key)
 {
     return 'form' . str_studly($key) . 'Attribute';
 }
Пример #4
0
 /**
  * Get class name.
  *
  * @return string
  */
 public function getClass()
 {
     return str_studly(class_basename($this->getName()));
 }
Пример #5
0
 /**
  * Generate request classes.
  */
 private function generateRequest()
 {
     if (!$this->confirm('Do you want to create form request classes?')) {
         return;
     }
     foreach (['Create', 'Update'] as $request) {
         $name = $this->getPrefix('/') . $this->getEntities() . '/' . $request . str_studly($this->getEntityName()) . 'Request';
         $this->console->call('generate:request', ['name' => $name, '--scaffold' => true, '--auth' => true, '--rules' => $this->console->option('fields'), '--force' => $this->console->option('force')]);
     }
 }
Пример #6
0
 /**
  * Get the module name in studly case.
  *
  * @return string
  */
 protected function getStudlyNameReplacement()
 {
     return str_studly($this->getName());
 }
Пример #7
0
 /**
  * Get class name.
  *
  * @return string
  */
 protected function getClass()
 {
     return str_studly($this->getStringArg('name'));
 }
Пример #8
0
 /**
  * Get model name
  *
  * @return string
  */
 protected function getFileName()
 {
     return str_studly($this->getStringArg('model'));
 }
Пример #9
0
 /**
  * Get master database seeder name for the specified module.
  *
  * @param string $name
  *
  * @return string
  */
 private function getSeederName($name)
 {
     $name = str_studly($name);
     $namespace = workbench()->config('namespace');
     return $namespace . '\\' . $name . '\\Database\\Seeders\\' . $name . 'DatabaseSeeder';
 }
Пример #10
0
 /**
  * Get prefix with slash suffix.
  *
  * @return string
  */
 public function getPrefixSlash()
 {
     return $this->prefix ? str_studly($this->prefix . '\\') : '';
 }
Пример #11
0
 /**
  * Get class name.
  *
  * @return string
  */
 public function getClass()
 {
     return str_studly($this->getMigrationName());
 }
Пример #12
0
 /**
  * Get name in studly case.
  *
  * @return string
  */
 public function getStudlyName()
 {
     return str_studly($this->name);
 }