How can I install Collective\Html\HtmlServiceProvider without composer?

☆樱花仙子☆ 提交于 2019-12-25 18:39:02

问题


I am on a cpanel shared hosting and don't have access to SSH. How can I install Collective\Html\HtmlServiceProvider without SSH? If I had SSH access I would use:

composer require laravelcollective/html

But I don't know what to do now.


回答1:


Another solution would be downloading it locally with composer and uploading the entire project (including the vendor folder) with a ftp client.




回答2:


Step 1:

Go to https://github.com/LaravelCollective/html and download the repo.

Step 2

Copy the zip and navigate to your project. Inside the vendor folder create folder laravelcollective and then inside html. Inside the html folder place the repo.

Step 3

On your composer.json file on the root directory of your project add the following lines.

"autoload": {
    "psr-4": {
       "Collective\\Html\\": "vendor/laravelcollective/html/src/"
    },
}

and then do

composer dump-autoload

Step 4

Next, add your new provider to the providers array of config/app.php:

'providers' => [
    // ...
    Collective\Html\HtmlServiceProvider::class,
    // ...
  ],

Finally, add two class aliases to the aliases array of config/app.php:

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


来源:https://stackoverflow.com/questions/42043484/how-can-i-install-collective-html-htmlserviceprovider-without-composer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!