title: Passing data from React component to Laravel controller
body: <p>I a laravel project using React js for the font-end , i would like to pass some data rendered by a React component to my controller. In a blade template i have a form , and within that form , i'm displaying a "select" element using React js. How to pass the value in the select element via the Request(Request $request) variable to the controller?
  Here is my form in the blade template:</p>
  
  <pre><code>&lt;form method="POST" action=""&gt;
          @csrf
  
      &lt;div id="example" data={{ $currencies }}&gt;&lt;/div&gt;
  
      &lt;input type="submit" value="Create" class="btn btn-primary"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>And there is the component:</p>
  
  <pre><code>class Example extends Component {
      render() {
                  return(
              &lt;div&gt;
            &lt;select&gt;
              &lt;option&gt;&lt;/option&gt;
              &lt;option&gt;Currency&lt;/option&gt;
              &lt;option&gt;Reputation&lt;/option&gt;
            &lt;/select&gt;
  
          &lt;/div&gt;
              );
  
              }
    }
  
  export default Example;
  
  if (document.getElementById('example')) {
       var data = document.getElementById('example').getAttribute('data');
      ReactDOM.render(&lt;Example data={data}/&gt;, document.getElementById('example'));
  }
  </code></pre>