Today now in this post we know about Laravel ajax render view with data. Sometimes, we are use get html view layout from the ajax request. On that we have to need first render view file and then we need to store view in a variable and then we will return that variable. Now in bellow example i will render view also with pass data.
you can see that how i did on the bellow example:
$data = $this->semester->getSemesterName($input); $type = "Subject"; $options = view("home.ajax",compact('data','type'))->render(); return $options;
Thanks for read. I hope it help you. For more you can follow us on facebook.