我正在开发一个博客作为Laravel 5.3的定制软件包。无法在Laravel5.3中注册我的定制软件包的依赖关系
到目前为止,我已经掌握了路线,控制器,模型和迁移工作。
我现在正在研究CRUD。对于形式,我想我可以利用这个: https://laravelcollective.com/docs/5.3/html
UPDATE
我已经安装的软件包与作曲家。依赖项位于composer.json文件中。这些文件位于我的软件包的供应商文件夹中。 我也想跑
composer dump-autoload -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');
}
我目前得到的以下错误无处不在:
FatalThrowableError in Application.php line 610: Class 'Collective\Html\HtmlServiceProvider' not found
真的不知道我哪里出错了。
UPDATE
我已经试过,而不是注册绑定:
$this->app->bind('Collective\Html\HtmlServiceProvider');
但这次我得到以下错误:
Class 'Collective\Html\FormFacade' not found
嗨,是的,我有,抱歉忘了补充说我不知道如何编辑帖子。我已经添加它作为上面的评论。 –
您是否尝试过运行'composer dump-autoload -o'? – Ryan
是的我也尝试过运行这个 –