Laravel ajax render view with data example

By Hardik Savani | May 6, 2016 | | 1621 Viewer | Category : Laravel


Share this post:

Sometimes, we use get html view layout from ajax request. At that you have to first render view file and then you need to store view in varibale and then we can return that varibale. In bellow example i render view with pass data you can see how i did:

Example:

$data = $this->semester->getSemesterName($input);

$type = "Subject";

$options = view("home.ajax",compact('data','type'))->render();


return $options;