files()->name('*.php')->in(base_path().'/app'); foreach ($finder as $file) { $namespace = 'App\\'; if ($relativePath = $file->getRelativePath()) { $namespace .= strtr($relativePath, '/', '\\') . '\\'; } $class = $namespace . $file->getBasename('.php'); try { $r = new \ReflectionClass($class); if ($r->isSubclassOf('Illuminate\\Database\\Eloquent\\Model')) { class_alias($class, $file->getBasename('.php')); } } catch (Exception $e) { // } } } } aliasModels(); return [ 'startupMessage' => 'Using local config file (tinker.config.php)', 'commands' => [ // new \App\Tinker\TestCommand, ], ];