Laravel ajax render view with data example

By Hardik Savani September 6, 2020 Category : Laravel

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:


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

$type = "Subject";

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

return $options;

We are Recommending you