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.
Here is my Code..
<li>
<a href="#suppression" data-toggle="modal" onclick="getForm('{{ $data->id }}')"> Get Modal</a>
</li>
and my jquery method is
function getForm(id)
{
$.ajax({
url: '/student-forms/get-form/'+id,
type: "GET",
});
}
Controller method is
public function getForm($id)
{
$user = DB::table('users')->select('name','type','options')->whereIn('id' , $id)->get();
return $user;
}
I want to get above variable $user here in my model
<div id="suppression" class="modal" role="dialog" aria-hidden="true">
<div class="modal-dialog" style="width: 500px;">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
</div>
</div>
</div>
Please help how can i achieve using above jquery method Thanks
$userinmodal-body?