0
$dispatcher = new Illuminate\Events\Dispatcher;
$router = new Illuminate\Routing\Router($dispatcher);

$router->get( '/', [ HomeController::class, 'index' ] );

$request = Illuminate\Http\Request::createFromGlobals();
$response = $router->dispatch($request);
$response->send();

当我想去的时候/home,尝试获取404页面我无法获取404错误页面,并且Fatal error: Uncaught Symfony\Component\HttpKernel\Exception\NotFoundHttpException只看到

另外,我尝试将 AbstractRouteCollection.php 更改为从

throw new NotFoundHttpException;

require_once( ROOT . DS . "responses" . DS . "error" . DS . "404.php" );

我可以显示 404 页面但出现错误Fatal error: Uncaught Error: Call to a member function setContainer() on null

我不知道我能做什么。

作曲家.json

{
    "require": {
        "vlucas/phpdotenv": "^5.3",
        "google/apiclient": "^2.10",
        "facebook/graph-sdk": "5.7.0",
        "illuminate/database": "^8.62",
        "illuminate/routing": "^8.64",
        "illuminate/events": "^8.64"
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/",
            "Config\\": "config/"
        }
    }
}
4

0 回答 0