问题
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