Laravel ajax render view with data example

By Hardik Savani | May 6, 2016 | | 53034 Viewer | 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:

Example:

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

$type = "Subject";

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


return $options;




Hardik Savani
My name is Hardik Savani. I'm a full-stack developer, entrepreneur and owner of Aatman Infotech. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Javascript, JQuery, Laravel, Codeigniter, VueJS, AngularJS and Bootstrap from the early stage.
Follow Me: Github Twitter
***Do you want me hire for your Project Work? Then Contact US.