Ejemplo n.º 1
0
 /**
  * Seed the specific module.
  *
  * @param  string $module
  * @return array
  */
 protected function seed($module)
 {
     $params = array();
     $moduleName = studly_case($module);
     $namespace = $this->module->getNamespace();
     $rootSeeder = $moduleName . 'DatabaseSeeder';
     $fullPath = $namespace . $moduleName . '\\Database\\Seeds\\' . $rootSeeder;
     if (\File::exists(base_path($fullPath . '.php'))) {
         if ($this->option('class')) {
             $params['--class'] = $this->option('class');
         } else {
             $params['--class'] = $fullPath;
         }
         if ($option = $this->option('database')) {
             $params['--database'] = $option;
         }
         $this->call('db:seed', $params);
     }
 }
Ejemplo n.º 2
0
 /**
  * Replace placeholder text with correct values.
  *
  * @return string
  */
 protected function formatContent($content)
 {
     return str_replace(['{{slug}}', '{{name}}', '{{module}}', '{{namespace}}', '{{singular}}', '{{model}}'], [$this->slug, studly_case($this->name), studly_case($this->slug), $this->module->getNamespace(), str_singular($this->name), str_singular(studly_case($this->name))], $content);
 }
Ejemplo n.º 3
0
 /**
  * Replace placeholder text with correct values.
  *
  * @param  string $content
  * @return string
  */
 protected function formatContent($content)
 {
     return str_replace(['{{className}}', '{{moduleName}}', '{{namespace}}', '{{pluralClassName}}', '{{singularClassName}}'], [$this->className, $this->moduleName, $this->module->getNamespace(), str_plural(strtolower($this->className)), str_singular(strtolower($this->className))], $content);
 }
 /**
  * Replace placeholder text with correct values.
  *
  * @param  string $content
  * @return string
  */
 protected function formatModelContent($content)
 {
     return str_replace(['{{namespace}}', '{{moduleName}}', '{{className}}', '{{table}}'], [$this->module->getNamespace(), $this->moduleName, $this->model, $this->table], $content);
 }