예제 #1
0
 function app($make = null, $parameters = [])
 {
     if (is_null($make)) {
         return Container::getInstance();
     }
     return Container::getInstance()->make($make, $parameters);
 }
예제 #2
0
 /**
  * Load all the factory config.
  *
  * @todo Add validation to the existence of the path.
  *
  * @before
  * @return void
  */
 protected function loadModelFactories()
 {
     $container = Container::getInstance();
     $factory = $container->make(EloquentFactory::class);
     $factory_path = $container->basePath('database/factories');
     $factory->load($factory_path);
     $container->instance(EloquentFactory::class, $factory);
 }
예제 #3
0
 /**
  * Configure the IoC container.
  *
  * @return void
  */
 private function configureContainer()
 {
     $container = $this->createContainer();
     $container->instance(ContainerContract::class, $container);
     Container::setInstance($container);
 }
예제 #4
0
 /**
  * Scan the directoies for the migration files.
  *
  * @return Collection
  */
 private function getMigrationFiles()
 {
     $filesystem = new Filesystem();
     $migration_path = Container::getInstance()->basePath('database/migrations');
     return collect($filesystem->files($migration_path));
 }