Error: Call to a member function connection() on null in E:\code\my-app\app\webman\vendor\illuminate\database\Eloquent\Model.php:1851
发现 config/bootstrap.php 没有 support\bootstrap\LaravelDb::class;
排查发现 github 仓库没有这个文件;
根据文档一步步全新安装框架及数据库ORM
win10
php:PHP 8.2.9 (cli) (built: Aug 1 2023 12:41:16) (NTS Visual C++ 2019 x64)
{
"name": "workerman/webman",
"type": "project",
"keywords": [
"high performance",
"http service"
],
"homepage": "https://www.workerman.net",
"license": "MIT",
"description": "High performance HTTP Service Framework.",
"authors": [
{
"name": "walkor",
"email": "walkor@workerman.net",
"homepage": "https://www.workerman.net",
"role": "Developer"
}
],
"support": {
"email": "walkor@workerman.net",
"issues": "https://github.com/walkor/webman/issues",
"forum": "https://wenda.workerman.net/",
"wiki": "https://workerman.net/doc/webman",
"source": "https://github.com/walkor/webman"
},
"require": {
"php": ">=8.1",
"workerman/webman-framework": "~2.1",
"monolog/monolog": "^2.0",
"webman/redis": "^2.1",
"webman/cache": "^2.1",
"webman/redis-queue": "^1.3",
"vlucas/phpdotenv": "^5.6",
"workerman/crontab": "^1.0",
"webman/console": "^2.1",
"firebase/php-jwt": "^6.11",
"tinywan/jwt": "^1.11",
"php-di/php-di": "^7.0",
"webman-tech/laravel-validation": "^11.0",
"ramsey/uuid": "^4.9",
"ext-pdo": "*",
"webman/event": "^1.0",
"webman/database": "^2.1",
"illuminate/pagination": "^11.45",
"illuminate/events": "^11.45",
"symfony/var-dumper": "^7.3",
"workerman/workerman": "~5.1"
},
"suggest": {
"ext-event": "For better performance. "
},
"autoload": {
"psr-4": {
"": "./",
"app\\": "./app",
"App\\": "./app",
"app\\View\\Components\\": "./app/view/components"
}
},
"scripts": {
"post-package-install": [
"support\\Plugin::install"
],
"post-package-update": [
"support\\Plugin::install"
],
"pre-package-uninstall": [
"support\\Plugin::uninstall"
]
},
"minimum-stability": "dev",
"prefer-stable": true,
"require-dev": {
"phpunit/phpunit": "^11.5",
"mockery/mockery": "^1.6"
}
}
手动新建文件, 并在config/bootstrap.php 引入即可解决。

walkor/webman-framework
v2.0.0 存在该文件,之后版本,LaravelDb 被移除。