Beispiel #1
0
 /**
  * Filter the array using the given Closure.
  *
  * @param  array     $array
  * @param  \Closure  $callback
  * @return array
  */
 function array_where($array, Closure $callback)
 {
     return Arr::where($array, $callback);
 }
 /**
  * Run migrations for the specified module.
  *
  * @param string $slug
  *
  * @return mixed
  */
 protected function migrate($slug)
 {
     if (!$this->module->exists($slug)) {
         return $this->error('Module does not exist.');
     }
     $pretend = Arr::get($this->option(), 'pretend', false);
     $path = $this->getMigrationPath($slug);
     $this->migrator->run($path, $pretend);
     //
     foreach ($this->migrator->getNotes() as $note) {
         if (!$this->option('quiet')) {
             $this->line($note);
         }
     }
     if ($this->option('seed')) {
         $this->call('module:seed', ['module' => $slug, '--force' => true]);
     }
 }