Пример #1
0
 /**
  * Write migration output.
  *
  * @param  \Orchestra\Tenanti\Migrator\FactoryInterface  $migrator
  *
  * @return void
  */
 protected function writeMigrationOutput(FactoryInterface $migrator)
 {
     // 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 ($migrator->getNotes() as $note) {
         $this->output->writeln($note);
     }
     $migrator->flushNotes();
 }
Пример #2
0
 /**
  * Resolve model entity.
  *
  * @param  \Orchestra\Tenanti\Migrator\FactoryInterface  $migrator
  * @param  array  $data
  *
  * @return \Illuminate\Database\Eloquent\Model|null
  */
 protected function resolveModelEntity(FactoryInterface $migrator, $data)
 {
     $id = Arr::get($data, 'id');
     return $migrator->getModel()->newInstance()->find($id);
 }