title: How to get Laravel validation errors in react component which is in Laravel blade
body: <p>I'm new to React. I'm using react form component <strong>partially</strong> in the Laravel blade. Then how can I send validation error messages from controllers to that react component which is resides in the Laravel blade file.</p>
  
  <p>In my Controller,</p>
  
  <pre><code>public function store(Request $request)
  {
      $rules = [
        'name' =&gt; 'required',
        'publish_at' =&gt; 'required|datetime'
      ];
  
      $this-&gt;validate($request, $rules);
  
      $book = Book::create([
          'name' =&gt; $request-&gt;name,
          'publish_at' =&gt; $request-&gt;publish_at
      ]);
  
      return response()-&gt;json($book);
  }
  </code></pre>
  
  <p>In my laravel blade,</p>
  
  <pre><code> &lt;form method="POST" action="patients"&gt;
       @csrf
       &lt;div class="form-group"&gt;
           &lt;label for="name"&gt;Name&lt;/label&gt;
           &lt;input type="text" name="name" class="form-control" placeholder=". . ."&gt;
           @error('name')
           &lt;span class="text-danger"&gt;{{ $message }}&lt;/span&gt;
           @enderror
       &lt;/div&gt;
  
       &lt;div id="publish_at"&gt;&lt;/div&gt; &lt;!-- this is react component --&gt;
  
       &lt;button type="submit"&gt;Submit&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>