Laravel-PHP致命错误:继承ArrayAccess时:未捕获的错误异常:照明\支持\集合::偏移量存在的返回类型($key)

hiz5n14c  于 2023-02-05  发布在  PHP
关注(0)|答案(1)|浏览(728)

我正在尝试运行php工匠服务命令,但我不能.我面临这个错误
PHP Fatal error: During inheritance of ArrayAccess: Uncaught ErrorException: Return type of Illuminate\Support\Collection::offsetExists($key)
我的php版本是PHP 8.1.12(cli).
我的composer.json文件是

"name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "require": {
        "php": "^7.1.3",
        "anhskohbo/no-captcha": "^3.2",
        "crocodicstudio/crudbooster": "^5.4",
        "fideloper/proxy": "^4.0",
        "laravel/framework": "5.8.*",
        "laravel/tinker": "^1.0"
    },
    "require-dev": {
        "beyondcode/laravel-dump-server": "^1.0",
        "filp/whoops": "^2.0",
        "fzaninotto/faker": "^1.4",
        "mockery/mockery": "^1.0",
        "nunomaduro/collision": "^3.0",
        "phpunit/phpunit": "^7.5"
    },

我想我必须升级我的Laravel项目版本。
请你帮我把这个问题搞清楚,帮我解决这个问题。
我会非常感谢你的。

2izufjch

2izufjch1#

请降低您的php版本。编写器“php”:“^7.1.3”,但您使用的是PHP 8.1.12。或者您可以升级Laravel版本检查https://bytexd.com/fix-laravel-return-type-of-illuminatesupportcollectionoffsetexistskey/

相关问题