我正在学习Laravel 5,我想在Laravel 5.8中安装laravelcollective / html。 我发现了(在这里和其他地方)几种方法。但是,我没有尝试过它们。 我将XAMPP 3.2.2用作Windows 10上的本地服务器。
首先,我添加了这一行
"laravelcollective/html": "5.8.*"
保存到我的composer.json的require数组。 然后,在我的项目目录中,运行命令
composer update
PS C:\xampp\htdocs\mylaravel> composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
以上是我终端的副本和粘贴。该过程在该级别停止。
我尝试通过运行以下命令来安装laravelcollective / html软件包:
composer require "laravelcollective/html:5.8.*"
在这种情况下,我用 composer require 尝试了其他一些参数,例如:
composer require 'laravelcollective/html:5.8.*'
composer require "laravelcollective/html:5.8.*"
composer require "laravelcollective/html:5.8.0"
composer require 'laravelcollective/html:5.8.0'
composer require 'laravelcollective/html:^5.8.0'
composer require "laravelcollective/html:^5.8.0"
即使没有说明版本的参数:
composer require 'laravelcollective/html'
所有结果都相同
PS C:\xampp\htdocs\mylaravel> composer require 'laravelcollective/html:^5.8.0'
[Composer\Downloader\TransportException]
The "https://packagist.org/p/provider-2019-04%241d52886260d9f0e30a70676feea97a605da410b08fd409cad3de1a04bb47c878.json" file could not be downloaded (HTTP
/1.1 404 Not Found)
require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--update-with-all-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] [<packages>]...
任何帮助将不胜感激
答案 0 :(得分:1)
尝试添加此版本
"laravelcollective/html": "^5.4.0"
然后执行
composer update
答案 1 :(得分:0)
来自LaravelCollective/HTML docs:
首先通过Composer安装此软件包。编辑项目的composer.json文件以要求使用laravelcollective / html。
composer require 'laravelcollective/html:^5.4.*'
接下来,将您的新提供程序添加到config / app.php的提供程序数组中:
'providers' => [
// ...
Collective\Html\HtmlServiceProvider::class,
// ...
],
最后,将两个类别名添加到config / app.php的别名数组中:
'aliases' => [
// ...
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
// ...
],
用composer update
完成它,您应该已设置好!