title: Laravel 4.2: Troubleshooting "Target not instantiable" error
body: <p>I've been stuck on this "Target not instantiable" error for the last 2-3 days and I have no idea why. Someone in the IRC #laravel chat room, yesterday, suggested using <code>var_dump(App::make('Project\Frontend\Repo\Lead\LeadInterface'))</code> when in Artisan's tinker interface which I've done and got this response:</p>
  
  <pre><code>class Project\Frontend\Repo\Lead\EloquentLead#798 (1) {
    protected $lead =&gt;
    class Lead#809 (21) {
      // bunch of info about the model etc relating to the interface and it's repo class
    }
  }
  </code></pre>
  
  <p>One of the members in #laravel pointed out that this meant the interface was instantiated which is great but then I realised this isn't the interface that I'm having a problem with. </p>
  
  <p>So below is how I have things setup. The interface that's apparently not instantiated is ValidableInterface (last portion of code) and running <code>var_dump(App::make('Project\Backend\Service\Validation\ValidableInterface'))</code>
  returns the dreaded "Target not instantiable" error. </p>
  
  <p>EDIT: <code>new LeadFormLaravelValidator( $app['validator'] )</code> extends AbstractLaravelValidator which implements ValidableInterface.</p>
  
  <p>Am I missing some glaring problem with my code?</p>
  
  <p>My service provider</p>
  
  <pre><code>&lt;?php namespace Project\Frontend\Service\Form;
  
  use Illuminate\Support\ServiceProvider;
  use Project\Frontend\Service\Form\Lead\LeadForm;
  use Project\Frontend\Service\Form\Lead\LeadFormLaravelValidator;
  
  class FormServiceProvider extends ServiceProvider {
  
  /**
   * Register the binding
   *
   * @return void
   */
  public function register()
  {
      $app = $this-&gt;app;
  
      $app-&gt;bind('Project\Frontend\Service\Form\Lead\LeadForm', function($app)
      {
          return new LeadForm(
              new LeadFormLaravelValidator( $app['validator'] ),
              $app-&gt;make('Project\Frontend\Repo\Lead\LeadInterface')
          );
      });
  }
  
  }
  </code></pre>
  
  <p>My form class</p>
  
  <pre><code>&lt;?php namespace Project\Frontend\Service\Form\Lead;
  
  use Project\Backend\Service\Validation\ValidableInterface;
  use Project\Frontend\Repo\Lead\LeadInterface;
  
  class LeadForm {
  
  /**
   * Form Data
   *
   * @var array
   */
  protected $data;
  
  /**
   * Validator
   *
   * @var \Project\Backend\Service\Validation\ValidableInterface
   */
  protected $validator;
  
  /**
   * Lead repository
   *
   * @var \Project\Frontend\Repo\Lead\LeadInterface
   */
  protected $lead;
  
  public function __construct(ValidableInterface $validator, LeadInterface $lead)
  {
      $this-&gt;validator = $validator;
      $this-&gt;lead = $lead;
  }
  </code></pre>
  
  <p>My validation rules</p>
  
  <pre><code>&lt;?php namespace Project\Frontend\Service\Form\Lead;
  
  use Project\Backend\Service\Validation\AbstractLaravelValidator;
  
  class LeadFormLaravelValidator extends AbstractLaravelValidator {
  
  /**
   * Validation rules
   *
   * @var Array
   */
  protected $rules = array(
      'name'              =&gt; 'required|regex:/^[a-zA-Z-\s]+$/',
      'email'             =&gt; 'email',
      'cell'              =&gt; 'required|numeric|digits_between:10,11',
  );
  
  /**
   * Validation messages
   *
   * @var Array
   */
  protected $messages = array(
      'regex'                 =&gt; 'The :attribute may only contain letters, dashes and spaces.',
      'digits_between'        =&gt; 'The :attribute must be 10 numbers long.',
  );
  
  }
  </code></pre>
  
  <p>My abstract validator</p>
  
  <pre><code>&lt;?php namespace Project\Backend\Service\Validation;
  
  use Illuminate\Validation\Factory;
  
  abstract class AbstractLaravelValidator implements ValidableInterface {
  
  /**
   * Validator
   *
   * @var \Illuminate\Validation\Factory
   */
  protected $validator;
  
  /**
   * Validation data key =&gt; value array
   *
   * @var Array
   */
  protected $data = array();
  
  /**
   * Validation errors
   *
   * @var Array
   */
  protected $errors = array();
  
  /**
   * Validation rules
   *
   * @var Array
   */
  protected $rules = array();
  
  /**
   * Custom validation messages
   *
   * @var Array
   */
  protected $messages = array();
  
  public function __construct(Factory $validator)
  {
      $this-&gt;validator = $validator;
  }
  
  /**
   * Set data to validate
   *
   * @return \Project\Backend\Service\Validation\AbstractLaravelValidator
   */
  public function with(array $data)
  {
      $this-&gt;data = $data;
  
      return $this;
  }
  
  /**
   * Validation passes or fails
   *
   * @return Boolean
   */
  public function passes()
  {
      $validator = $this-&gt;validator-&gt;make($this-&gt;data, $this-&gt;rules, $this-&gt;messages);
  
      if( $validator-&gt;fails() )
      {
          $this-&gt;errors = $validator-&gt;messages();
          return false;
      }
  
      return true;
  }
  
  /**
   * Return errors, if any
   *
   * @return array
   */
  public function errors()
  {
      return $this-&gt;errors;
  }
  
  }
  </code></pre>
  
  <p>My validator interface</p>
  
  <pre><code>&lt;?php namespace Project\Backend\Service\Validation;
  
  interface ValidableInterface {
  
  /**
   * Add data to validation against
   *
   * @param array
   * @return \Project\Backend\Service\Validation\ValidableInterface  $this
   */
  public function with(array $input);
  
  /**
   * Test if validation passes
   *
   * @return boolean
   */
  public function passes();
  
  /**
   * Retrieve validation errors
   *
   * @return array
   */
  public function errors();
  
  }
  </code></pre>