我正在开发一个博客作为 Laravel 5.3 的自定义包。
到目前为止,我已经完成了路由、控制器、模型和迁移工作。
我现在正在研究 CRUD。对于我认为可以使用的表格: https ://laravelcollective.com/docs/5.3/html
更新
我已经用作曲家安装了这个包。依赖项在 composer.json 文件中。这些文件位于我的包的供应商文件夹中。我也试过跑
作曲家转储自动加载-o
来自我的 composer.json
"require": {
"laravelcollective/html": "5.3.*"
}
我到处寻找,人们建议执行以下操作:
/**
* Register bindings in the container.
*
* @return void
*/
public function register()
{
// Bind the app.
$this->app->bind('blog', function ($app) {
return new Blog;
});
// Register LaravelCollective Form Builder.
$this->app->register('Collective\Html\HtmlServiceProvider');
$this->app->alias('Form', 'Collective\Html\FormFacade');
$this->app->alias('Html', 'Collective\Html\HtmlFacade');
}
我目前到处都收到以下错误:
Application.php 第 610 行中的 FatalThrowableError:找不到类“Collective\Html\HtmlServiceProvider”
真的不知道我哪里出错了。
更新
我试过绑定而不是注册:
$this->app->bind('Collective\Html\HtmlServiceProvider');
但是这次我收到以下错误:
找不到类“Collective\Html\FormFacade”