在laravel中找不到供应商类

时间:2017-01-24 21:43:38

标签: php laravel laravel-5 laravel-5.3

我在项目中使用unisharp file manager。在我的本地机器上一切正常,但在远程服务器上它会抛出错误[Symfony\Component\Debug\Exception\FatalErrorException] Class 'Unisharp\Laravelfilemanager\LaravelFilemanagerServiceProvider' not foundconfig/app.php一切正确

    /*FileMananger*/
    Unisharp\Laravelfilemanager\LaravelFilemanagerServiceProvider::class,
    Intervention\Image\ImageServiceProvider::class,
    /*CKEditor*/
    Unisharp\Ckeditor\ServiceProvider::class,

vedor中有目录unisharp(因此所有文件和目录都在那里)。当我尝试运行composer install / update时,我再次收到此错误。所以一切都在正确的位置,但是laravel并没有看到这个课程。

comoser.json

{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
    "php": ">=5.6.4",
    "laravel/framework": "5.3.*",
    "maatwebsite/excel": "~2.1.0",
    "appzcoder/crud-generator": "^1.2",
    "laravelcollective/html": "^5.3",
    "lavary/laravel-menu": "dev-master",
    "nesbot/carbon": "^1.21",
    "laracasts/flash": "^2.0",
    "spatie/laravel-medialibrary": "^3.11",
    "firebase/php-jwt": "^4.0",
    "doctrine/dbal": "^2.5"
},
"require-dev": {
    "fzaninotto/faker": "~1.4",
    "mockery/mockery": "0.9.*",
    "phpunit/phpunit": "~5.0",
    "symfony/css-selector": "3.1.*",
    "symfony/dom-crawler": "3.1.*"
},
"autoload": {
    "classmap": [
        "database"
    ],
    "psr-4": {
        "App\\": "app/"
    },
    "files": [
        "app/Http/helpers.php"
    ]
},
"autoload-dev": {
    "classmap": [
        "tests/TestCase.php"
    ]
},
"scripts": {
    "post-root-package-install": [
        "php -r \"file_exists('.env') || 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"
}
}

4 个答案:

答案 0 :(得分:3)

尝试在config/app.php中对这些行进行评论,然后再次运行composer require unisharp/laravel-filemanager

在通过作曲家下载之前,您无法设置服务提供商。

答案 1 :(得分:1)

您需要运行:

composer require unisharp/laravel-filemanager

答案 2 :(得分:0)

确保您的config / app.php unisharp提供程序与文件夹供应商unisharp composer.json中的内容匹配 检查以下内容:

Config / app.php enter image description here

vendor / unisharp-composer.json enter image description here

答案 3 :(得分:0)

解决方案很简单:) 只需确保您的服务提供商有此功能:

Unisharp\Laravelfilemanager\LaravelFilemanagerServiceProvider::class,

不是这个:

UniSharp\Laravelfilemanager\LaravelFilemanagerServiceProvider::class,