刚创建项目 试下DB查询就报错了

wazd12

问题描述

按照官方的文档 创建了项目
在window上运行

写了个DB查询

运行报错了

程序代码

 public function db(Request $request)
    {
        $default_uid = 29;
        $uid = $request->get('uid', $default_uid);
        $name = Db::table('users')->where('uid', $uid)->value('username');
        return response("hello $name");
    }

报错信息

Error: Class "Illuminate\Database\Capsule\Manager" not found in D:\soft\EServer\core\software\tool\Composer\webman\vendor\workerman\webman-framework\src\support\Db.php:34
Stack trace:
#0 D:\soft\EServer\core\software\tool\Composer\webman\vendor\composer\ClassLoader.php(571): include()
#1 D:\soft\EServer\core\software\tool\Composer\webman\vendor\composer\ClassLoader.php(428): Composer\Autoload\includeFile('D:\\soft\\EServer...')
#2 D:\soft\EServer\core\software\tool\Composer\webman\app\controller\IndexController.php(36): Composer\Autoload\ClassLoader->loadClass('support\\Db')
#3 D:\soft\EServer\core\software\tool\Composer\webman\vendor\workerman\webman-framework\src\App.php(322): app\controller\IndexController->db(Object(support\Request))
#4 D:\soft\EServer\core\software\tool\Composer\webman\vendor\workerman\webman-framework\src\App.php(352): Webman\App::Webman\{closure}(Object(support\Request))
#5 D:\soft\EServer\core\software\tool\Composer\webman\vendor\webman\log\src\Middleware.php(96): Webman\App::Webman\{closure}(Object(support\Request))
#6 D:\soft\EServer\core\software\tool\Composer\webman\vendor\workerman\webman-framework\src\App.php(344): Webman\Log\Middleware->process(Object(support\Request), Object(Closure))
#7 D:\soft\EServer\core\software\tool\Composer\webman\vendor\workerman\webman-framework\src\App.php(141): Webman\App::Webman\{closure}(Object(support\Request))
#8 D:\soft\EServer\core\software\tool\Composer\webman\vendor\workerman\workerman\Connection\TcpConnection.php(646): Webman\App->onMessage(Object(Workerman\Connection\TcpConnection), Object(support\Request))
#9 D:\soft\EServer\core\software\tool\Composer\webman\vendor\workerman\workerman\Events\Select.php(311): Workerman\Connection\TcpConnection->baseRead(Resource id #129)
#10 D:\soft\EServer\core\software\tool\Composer\webman\vendor\workerman\workerman\Worker.php(1488): Workerman\Events\Select->loop()
#11 D:\soft\EServer\core\software\tool\Composer\webman\vendor\workerman\workerman\Worker.php(1405): Workerman\Worker::forkWorkersForWindows()
#12 D:\soft\EServer\core\software\tool\Composer\webman\vendor\workerman\workerman\Worker.php(560): Workerman\Worker::forkWorkers()
#13 D:\soft\EServer\core\software\tool\Composer\webman\vendor\workerman\webman-framework\src\support\App.php(131): Workerman\Worker::runAll()
#14 D:\soft\EServer\core\software\tool\Composer\webman\start.php(4): support\App::run()
#15 {main}

操作系统及workerman/webman等框架组件具体版本

        "name": "workerman/webman-framework",
        "version": "v1.5.23",
102 1 0
1个回答

wazd12

不好意思 忽略这个提问
漏看这个安装组件了
composer require -W illuminate/database illuminate/pagination illuminate/events symfony/var-dumper laravel/serializable-closure

  • 暂无评论
×
🔝