title: Laravel Extend Form Helper Class
body: <p>I'm using Laravel 5.1 and have installed the Collective's HTML and FORM helper.</p>
  
  <p>I'm now trying to extend this to handle a couple of custom form elements but am struggling to get it working. My current error is:</p>
  
  <pre><code> Argument 1 passed to Collective\Html\FormBuilder::__construct() must be an instance of Collective\Html\HtmlBuilder, instance of Illuminate\Foundation\Application given
  </code></pre>
  
  <p>My class extends FormBuilder as follows:</p>
  
  <pre><code>namespace Helpers;
  </code></pre>
  
  <p>use \Collective\Html\FormBuilder;</p>
  
  <pre><code>class MyFormHelper extends FormBuilder
  {
  
  
      public function arrayHidden($name, $value = null, $options = array())
      {
          ddd($value);
          return $this-&gt;input('hidden', $name, $value, $options);
      }
  }
  </code></pre>
  
  <p>so at the moment I'm simply expecting to evaluate <code>$value</code></p>
  
  <p>My knowledge of extending classes is limited but assumed this would work</p>
  
  <p>The FormBuilder class from the package is:</p>
  
  <pre><code>&lt;?php namespace Collective\Html;
  
  use DateTime;
  use Illuminate\Routing\UrlGenerator;
  use Illuminate\Session\Store as Session;
  use Illuminate\Support\Traits\Macroable;
  
  class FormBuilder {
  
  use Macroable;
  
  /**
   * The HTML builder instance.
   *
   * @var \Collective\Html\HtmlBuilder
   */
  protected $html;
  
  /**
   * The URL generator instance.
   *
   * @var \Illuminate\Routing\UrlGenerator  $url
   */
  protected $url;
  
  /**
   * The CSRF token used by the form builder.
   *
   * @var string
   */
  protected $csrfToken;
  
  /**
   * The session store implementation.
   *
   * @var \Illuminate\Session\Store
   */
  protected $session;
  
  /**
   * The current model instance for the form.
   *
   * @var mixed
   */
  protected $model;
  
  /**
   * An array of label names we've created.
   *
   * @var array
   */
  protected $labels = array();
  
  /**
   * The reserved form open attributes.
   *
   * @var array
   */
  protected $reserved = array('method', 'url', 'route', 'action', 'files');
  
  /**
   * The form methods that should be spoofed, in uppercase.
   *
   * @var array
   */
  protected $spoofedMethods = array('DELETE', 'PATCH', 'PUT');
  
  /**
   * The types of inputs to not fill values on by default.
   *
   * @var array
   */
  protected $skipValueTypes = array('file', 'password', 'checkbox', 'radio');
  
  /**
   * Create a new form builder instance.
   *
   * @param  \Illuminate\Routing\UrlGenerator  $url
   * @param  \Collective\Html\HtmlBuilder  $html
   * @param  string  $csrfToken
   * @return void
   */
  public function __construct(HtmlBuilder $html, UrlGenerator $url, $csrfToken)
  {
      $this-&gt;url = $url;
      $this-&gt;html = $html;
      $this-&gt;csrfToken = $csrfToken;
  }
  </code></pre>
  
  <p>So - how can I correctly extend FormBuilder to add custom functions?</p>
  
  <p>THanks</p>