致命错误:类';Collective\Html\HtmlServiceProvider';与heroku一起部署时在Laravel中找不到

致命错误:类';Collective\Html\HtmlServiceProvider';与heroku一起部署时在Laravel中找不到,laravel,Laravel,这是我的composer.json: { "name": "laravel/laravel", "description": "The Laravel Framework.", "keywords": ["framework", "laravel"], "license": "MIT", "type": "project", "require": { "php": ">=5.5.9", "laravel/fr

这是我的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"
    }
}
问题是:

[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: 

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

  'providers' => [
    // ...
    Collective\Html\HtmlServiceProvider::class,
    // ...
  ],
'aliases' => [
    // ...
      'Form' => Collective\Html\FormFacade::class,
      'Html' => Collective\Html\HtmlFacade::class,
    // ...
  ],
将两个类别名添加到config/app.php的别名数组中:

  'providers' => [
    // ...
    Collective\Html\HtmlServiceProvider::class,
    // ...
  ],
'aliases' => [
    // ...
      'Form' => Collective\Html\FormFacade::class,
      'Html' => Collective\Html\HtmlFacade::class,
    // ...
  ],

首先通过Composer安装此软件包。编辑项目的composer.json文件以要求laravelcollective/html

使用此命令

composer require "laravelcollective/html":"^5.4.0"
接下来,将您的新提供者添加到config/app.php的提供者数组中:

  'providers' => [
    // ...
    Collective\Html\HtmlServiceProvider::class,
    // ...
  ],
  'aliases' => [
    // ...
      'Form' => Collective\Html\FormFacade::class,
      'Html' => Collective\Html\HtmlFacade::class,
    // ...
  ],
将两个类别名添加到config/app.php的别名数组中

  'providers' => [
    // ...
    Collective\Html\HtmlServiceProvider::class,
    // ...
  ],
  'aliases' => [
    // ...
      'Form' => Collective\Html\FormFacade::class,
      'Html' => Collective\Html\HtmlFacade::class,
    // ...
  ],

更多帮助:-有关Laravel框架的表单和Html的官方文档,请访问网站

composer安装