hasMigrations() 공개 메소드

Tests whether the extension has migrations.
public hasMigrations ( ) : boolean
리턴 boolean
예제 #1
0
 /**
  * Runs the database migrations for the extension.
  *
  * @param Extension $extension
  * @param bool|true $up
  */
 public function migrate(Extension $extension, $up = true)
 {
     if ($extension->hasMigrations()) {
         $migrationDir = $extension->getPath() . '/migrations';
         $this->app->bind('Illuminate\\Database\\Schema\\Builder', function ($container) {
             return $container->make('Illuminate\\Database\\ConnectionInterface')->getSchemaBuilder();
         });
         if ($up) {
             $this->migrator->run($migrationDir, $extension);
         } else {
             $this->migrator->reset($migrationDir, $extension);
         }
     }
 }