getName() 공개 메소드

Get name.
public getName ( ) : string
리턴 string
예제 #1
0
 /**
  * Run the migration from the specified module.
  *
  * @param Module $module
  *
  * @return mixed
  */
 protected function migrate(Module $module)
 {
     $path = str_replace(base_path(), '', (new Migrator($module))->getPath());
     $this->call('migrate', ['--path' => $path, '--database' => $this->option('database'), '--pretend' => $this->option('pretend'), '--force' => $this->option('force')]);
     if ($this->option('seed')) {
         $this->call('module:seed', ['module' => $module->getName()]);
     }
 }
예제 #2
0
 /**
  * @param Module $module
  *
  * @return void
  */
 public function moduleSeed(Module $module)
 {
     $seeders = [];
     $name = $module->getName();
     $config = $module->get('migration');
     if (is_array($config) && array_key_exists('seeds', $config)) {
         foreach ((array) $config['seeds'] as $class) {
             if (@class_exists($class)) {
                 $seeders[] = $class;
             }
         }
     } else {
         $class = $this->getSeederName($name);
         //legacy support
         if (@class_exists($class)) {
             $seeders[] = $class;
         }
     }
     if (count($seeders) > 0) {
         array_walk($seeders, [$this, 'dbSeed']);
         $this->info("Module [{$name}] seeded.");
     }
 }
예제 #3
0
 /** @test */
 public function it_gets_studly_name()
 {
     $this->assertEquals('Recipe', $this->module->getName());
 }