function app($make = null, $parameters = []) { if (is_null($make)) { return Container::getInstance(); } return Container::getInstance()->make($make, $parameters); }
/** * 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); }
/** * Configure the IoC container. * * @return void */ private function configureContainer() { $container = $this->createContainer(); $container->instance(ContainerContract::class, $container); Container::setInstance($container); }
/** * 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)); }