diff --git a/src/Manavo/BootstrapForms/BootstrapFormsServiceProvider.php b/src/Manavo/BootstrapForms/BootstrapFormsServiceProvider.php index c82b822..c055418 100644 --- a/src/Manavo/BootstrapForms/BootstrapFormsServiceProvider.php +++ b/src/Manavo/BootstrapForms/BootstrapFormsServiceProvider.php @@ -1,8 +1,8 @@ app->bindShared('form', function ($app) { + $this->app->singleton('form', function ($app) { $form = new FormBuilder($app['html'], $app['url'], - $app['session.store']->getToken()); + $app['view']); return $form->setSessionStore($app['session.store']); }); diff --git a/src/Manavo/BootstrapForms/FormBuilder.php b/src/Manavo/BootstrapForms/FormBuilder.php index 32dbb7e..3a95c6b 100644 --- a/src/Manavo/BootstrapForms/FormBuilder.php +++ b/src/Manavo/BootstrapForms/FormBuilder.php @@ -2,9 +2,9 @@ namespace Manavo\BootstrapForms; -use Illuminate\Html\FormBuilder as IlluminateFormBuilder; +use Collective\Html\FormBuilder as CollectiveFormBuilder; -class FormBuilder extends IlluminateFormBuilder +class FormBuilder extends CollectiveFormBuilder { /** @@ -64,7 +64,7 @@ public function openGroup( } } - return 'html->attributes($attributes) . '>' . $label; + return $this->toHtmlString('html->attributes($attributes) . '>' . $label); } /** @@ -89,7 +89,7 @@ public function closeGroup() } // Append the errors to the group and close it out. - return $errors . ''; + return $this->toHtmlString($errors . ''); } /**