title: Get variable in jquery method and use it in view (laravel 5.3)
body: <p>I am using jquery to get data from controller from controller i am returning a $user from controller method but don't know how to use it in view.</p>
  
  <p>Here is my Code.. </p>
  
  <pre><code>    &lt;li&gt;
  &lt;a href="#suppression" data-toggle="modal" onclick="getForm('{{ $data-&gt;id }}')"&gt; Get Modal&lt;/a&gt;
  &lt;/li&gt;
  </code></pre>
  
  <p>and my jquery method is</p>
  
  <pre><code>function getForm(id)
  {
      $.ajax({
          url: '/student-forms/get-form/'+id,
          type: "GET",
      });
  }
  </code></pre>
  
  <p>Controller method is</p>
  
  <pre><code>public function getForm($id)
  {
  
      $user = DB::table('users')-&gt;select('name','type','options')-&gt;whereIn('id' , $id)-&gt;get();
      return $user;
  
  }
  </code></pre>
  
  <p>I want to get above variable <code>$user</code> here in my model </p>
  
  <pre><code>&lt;div id="suppression" class="modal" role="dialog" aria-hidden="true"&gt;
  &lt;div class="modal-dialog" style="width: 500px;"&gt;
      &lt;div class="modal-content"&gt;
          &lt;div class="modal-header"&gt;
              &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&amp;times;&lt;/button&gt;
          &lt;/div&gt;
          &lt;div class="modal-body"&gt;
  
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>Please help how can i achieve using above jquery method Thanks</p>