title: Show Duplicate Error Message in Error list in View : Laravel 5
body: <p><strong>Below is my code to check if the record is duplicate or not.</strong></p>
  
  <pre><code>$Category = \App\Models\Category_Model
             ::where("Category", "=", $request-&gt;input('Category'))-&gt;first();
  if($Category != null) {
      return 'Duplicate';
  }
  </code></pre>
  
  <p><strong>Is there any way to inject this error message in the validation rule in such a way that this error message appears in View the error list in below section?</strong></p>
  
  <pre><code>@if (count($errors) &gt; 0)
      &lt;div class="alert alert-danger"&gt;
          &lt;ul&gt;
              @foreach ($errors-&gt;all() as $error)
                  &lt;li&gt;{{ $error }}&lt;/li&gt;
              @endforeach
          &lt;/ul&gt;
      &lt;/div&gt;
  @endif
  </code></pre>