致命错误:使用 Heroku 部署时,Laravel 中未找到“Collective\Html\HtmlServiceProvider”类

Kri*_*nov 5 laravel

这是我的composer.json:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",

    "require": {
        "php": ">=5.5.9",
        "laravel/framework": "5.2.*",
        "pusher/pusher-php-server": "~2.0",
        "vinkla/pusher": "^2.2",
        "laravelcollective/html": "^5.2",
        "illuminate/html": "^5.0"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.",
        "phpunit/phpunit": "~4.0",
        "phpspec/phpspec": "~2.1",
        "symfony/css-selector": "2.8.*|3.0.*",
        "symfony/dom-crawler": "2.8.*|3.0.*",
        "php": ">=5.5.9",
        "laravel/framework": "5.2.*",
        "pusher/pusher-php-server": "~2.0",
        "vinkla/pusher": "^2.2",
        "illuminate/html": "^5.0",
        "laravelcollective/html": "^5.2"

    },

    "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": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "pre-update-cmd": [
            "php artisan clear-compiled"
        ],
        "post-update-cmd": [
            "php artisan optimize"
        ]
    },
    "config": {
        "preferred-install": "dist"
    }
}
Run Code Online (Sandbox Code Playgroud)

问题是这样的:

[Symfony\Component\Debug\Exception\FatalThrowableError]             
remote:  Fatal error: Class 'Collective\Html\HtmlServiceProvider' not found  
remote:                                                                              
remote:        
remote:  Script php artisan clear-compiled handling the post-install-cmd event returned with an error
remote: 
Run Code Online (Sandbox Code Playgroud)

sam*_*m12 4

将新的提供者添加到 config/app.php 的提供者数组中:

  'providers' => [
    // ...
    Collective\Html\HtmlServiceProvider::class,
    // ...
  ],
Run Code Online (Sandbox Code Playgroud)

将两个类别名添加到 config/app.php 的 aliases 数组中:

'aliases' => [
    // ...
      'Form' => Collective\Html\FormFacade::class,
      'Html' => Collective\Html\HtmlFacade::class,
    // ...
  ],
Run Code Online (Sandbox Code Playgroud)