diff --git a/FormBuilder.php b/FormBuilder.php index 85dde67..0d60238 100644 --- a/FormBuilder.php +++ b/FormBuilder.php @@ -6,6 +6,13 @@ use Illuminate\Session\Store as Session; class FormBuilder { + /** + * The HTML builder instance. + * + * @var Illuminate\Html\HtmlBuilder + */ + protected $html; + /** * The URL generator instance. * @@ -59,12 +66,14 @@ class FormBuilder { * Create a new form builder instance. * * @param Illuminate\Routing\UrlGenerator $url + * @param Illuminate\Html\HtmlBuilder $html * @param string $csrfToken * @return void */ - public function __construct(UrlGenerator $url, $csrfToken) + public function __construct(HtmlBuilder $html, UrlGenerator $url, $csrfToken) { $this->url = $url; + $this->html = $html; $this->csrfToken = $csrfToken; } @@ -109,7 +118,7 @@ class FormBuilder { // Finally, we will concatenate all of the attributes into a single string so // we can build out the final form open statement. We'll also append on an // extra value for the hidden _method field if it's needed for the form. - $attributes = Html::attributes($attributes); + $attributes = $this->html->attributes($attributes); return '