laravel 调用未定义的函数 get()



当我在Laravel项目中运行命令时:

 php artisan optimize                                                      
[SymfonyComponentDebugExceptionFatalErrorException]  
Call to undefined function get()                         
Script php artisan optimize handling the post-update-cmd event returned with an error

[RuntimeException]  
Error Output:       

php artisan clear-compiled

[SymfonyComponentDebugExceptionFatalErrorException]  
Call to undefined function get()            

php artisan optimize --force

[SymfonyComponentDebugExceptionFatalErrorException]  
Call to undefined function get()  

{ 作曲家更新 加载包含包信息的作曲家存储库 更新依赖项(包括需求开发) - 删除 barryvdh/laravel-ide-helper (v2.1.4) - 删除符号/类加载器 (v3.1.0) 写入锁定文件 生成自动加载文件

Illuminate\Foundation\ComposerScripts::p ostUpdate PHP 工匠优化

[SymfonyComponentDebugExceptionFatalErrorException]  
Call to undefined function get()                         

 Script php artisan optimize handling the post-update-cmd event returned with an error

 [RuntimeException]  
Error Output:                   

}

我的作曲家.json是

{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
    "php": ">=5.5.9",
    "laravel/framework": "5.2.*",
    "laravelcollective/html": "5.2.*"
},
"require-dev": {
    "fzaninotto/faker": "~1.4",
    "mockery/mockery": "0.9.*",
    "phpunit/phpunit": "~4.0",
    "symfony/css-selector": "2.8.*|3.0.*",
    "symfony/dom-crawler": "2.8.*|3.0.*"
},
"autoload": {
    "classmap": [
        "database"
    ],
    "psr-4": {
        "App\": "app/"
    }
},
"autoload-dev": {
    "classmap": [
        "tests/TestCase.php"
    ]
},
"scripts": {
    "post-root-package-install": [
        "php -r "copy('.env.example', '.env');""
    ],
    "post-create-project-cmd": [
        "php artisan key:generate"
    ],
    "post-install-cmd": [
        "Illuminate\Foundation\ComposerScripts::postInstall",
        "php artisan optimize"
    ],
    "post-update-cmd": [
        "Illuminate\Foundation\ComposerScripts::postUpdate",
        "php artisan optimize"
    ]
},
"config": {
    "preferred-install": "dist"
}

}

那么,它出了什么问题,我该如何解决它?谢谢?

如果您在创建路由时出错,也会显示此错误。而不是Route::get(...)你可能已经放了Route:get(...).因此,只需检查您的routes/app/Http/Controllers/文件即可。

你在应用(模型或控制器)get()某处以错误的方式使用了该方法。修复它,所有命令将再次工作。

如果您需要更多帮助,请发布您最近添加的代码,该代码使用get()方法。

相关内容

  • 没有找到相关文章

最新更新