Move alias registration to the register method
This commit is contained in:
1 parent
cd84cf3aee
commit
628daabb20
1 file changed
+3
-2
@@ -21,6 +21,9 @@ class HtmlServiceProvider extends ServiceProvider {
|
|||||||
$this->registerHtmlBuilder();
|
$this->registerHtmlBuilder();
|
||||||
|
|
||||||
$this->registerFormBuilder();
|
$this->registerFormBuilder();
|
||||||
|
|
||||||
|
$this->app->alias('html', 'Illuminate\Html\HtmlBuilder');
|
||||||
|
$this->app->alias('form', 'Illuminate\Html\FormBuilder');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -30,7 +33,6 @@ class HtmlServiceProvider extends ServiceProvider {
|
|||||||
*/
|
*/
|
||||||
protected function registerHtmlBuilder()
|
protected function registerHtmlBuilder()
|
||||||
{
|
{
|
||||||
$this->app->alias('html', 'Illuminate\Html\HtmlBuilder');
|
|
||||||
$this->app->bindShared('html', function($app)
|
$this->app->bindShared('html', function($app)
|
||||||
{
|
{
|
||||||
return new HtmlBuilder($app['url']);
|
return new HtmlBuilder($app['url']);
|
||||||
@@ -44,7 +46,6 @@ class HtmlServiceProvider extends ServiceProvider {
|
|||||||
*/
|
*/
|
||||||
protected function registerFormBuilder()
|
protected function registerFormBuilder()
|
||||||
{
|
{
|
||||||
$this->app->alias('form', 'Illuminate\Html\FormBuilder');
|
|
||||||
$this->app->bindShared('form', function($app)
|
$this->app->bindShared('form', function($app)
|
||||||
{
|
{
|
||||||
$form = new FormBuilder($app['html'], $app['url'], $app['session.store']->getToken());
|
$form = new FormBuilder($app['html'], $app['url'], $app['session.store']->getToken());
|
||||||
|
|||||||
Reference in new issue
Block a user