/** * Register all of the model classes found in the db/model folder. * * @throws CannotAddNonexistentClass */ private function registerModels() { // if using eloquent then register all of the eloquent models. if ($this->config['database.eloquent_enabled']) { // register all of the model classes foreach ((new ClassFinder())->findClasses(path('database') . 'models') as $model) { Forge::set($model, function () use($model) { return new $model(); }); } } }
/** * **Detect and configure the environment.** * * @throws ConfigurationException */ private function detect_environment() { static::$env = ['developing' => env('APP_ENV', 'PRODUCTION') !== 'PRODUCTION', 'app_key' => env('APP_KEY', '[set me]'), 'debugging' => env('DEBUG', FALSE), 'testing' => env('TESTING', FALSE)]; // register this factory Forge::set([static::class, 'AppFactory'], $this); }