Home Laravel How to ajax render view with data in Laravel ?

How to ajax render view with data in Laravel ?

by Shahriar Sagor

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:

Example:
$data = $this->semester->getSemesterName($input);
$type = "Subject";
$options = view("home.ajax",compact('data','type'))->render();
return $options;

Read Also: Generate Captcha code and Validation by using BotDetect package in laravel

Thanks for read. I hope it help you. For more you can follow us onĀ facebook.

close

You may also like