标题令人困惑。基本上,我无法在不属于框架的类中访问Laravel的实用程序。 错误是:Call to a member function connection() on null in C:\xampp\htdocs\blazocket\vendor\laravel\framework\src\Illuminate\Databas e\Eloquent\Model.php:1571 我有一个基于棘轮库的Websocket服务器,它有以下结构: namespace App\Http\Websockets;
$server = new \Ratchet\App('localhost