title: How can check for an existing email in Laravel?
body: <p>I'm trying to check if the email is already exist my database on my <strong>subscribes</strong> table.</p>
  <hr />
  <h1>Form</h1>
  <pre><code>{!! Form::open(array('url' =&gt; '/subscribe', 'class' =&gt; 'subscribe-form', 'role' =&gt;'form')) !!}
  
  &lt;div class=&quot;form-group col-lg-7 col-md-8 col-sm-8 col-lg-offset-1&quot;&gt;
    &lt;label class=&quot;sr-only&quot; for=&quot;mce-EMAIL&quot;&gt;Email address&lt;/label&gt;
    &lt;input type=&quot;email&quot; name=&quot;subscribe_email&quot; class=&quot;form-control&quot; id=&quot;mce-EMAIL&quot; placeholder=&quot;Enter email&quot; required&gt;
  
    &lt;!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups--&gt;
    &lt;div style=&quot;position: absolute; left: -5000px;&quot;&gt;&lt;input type=&quot;text&quot; name=&quot;b_168a366a98d3248fbc35c0b67_73d49e0d23&quot; value=&quot;&quot;&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;form-group col-lg-3 col-md-4 col-sm-4&quot;&gt;&lt;input type=&quot;submit&quot; value=&quot;Subscribe&quot; name=&quot;subscribe&quot; id=&quot;mc-embedded-subscribe&quot; class=&quot;btn btn-primary btn-block&quot;&gt;&lt;/div&gt;
  
  
  {!! Form::close() !!}
  </code></pre>
  <hr />
  <h1>Controller</h1>
  <pre><code>public function postSubscribe() {
  
      // Validation
      $validator = Validator::make( Input::only('subscribe_email'),
  
          array(
              'email'  =&gt;'unique:subscribes',
              )
          );
  
      if ($validator-&gt;fails()) {
  
          return Redirect::to('/#footer')
          -&gt;with('subscribe_error','This email is already subscribed to us.')
          -&gt;withErrors($validator)-&gt;withInput();
  
      }else{
  
          dd(&quot;HERE&quot;);
  
          $subscribe        = new Subscribe;
          $subscribe-&gt;email = Input::get('subscribe_email');
          $subscribe-&gt;save();
  
          return Redirect::to('/thank-you');
  
      }
  
  }
  </code></pre>
  <hr />
  <h1>Debuging Steps</h1>
  <p>I tried inputting email that I know already exist in my db.
  I want to my validation to fail, and redirect me back to my <code>/#footer</code> (homepage).</p>
  <p>I try printing <code>dd(&quot;HERE&quot;);</code> if my vaildation not fail.</p>
  <p>BUT I keep getting <code>HERE</code> to print which mean my validation is not failing.
  Why is that happening ? I'm completely blank out now.
  Can someone please point out what I missed ?
  I know I am very close.</p>
  <p>Thanks.</p>