Laravel 5 render a view and store it’s contents in a variable

Sometimes you may want send the rendered view in the ajax response instead of showing on the browser.

To return html in the ajax response first you need to store the blade engine compiled HTML into the variable in side your controller action then you need to return the variable, you can store the compiled output into variable by type casting or by using render() method on the view object to return the content in string format.

Here is the trick:

I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.

0 0 vote
Article Rating
Subscribe
Notify of
guest
2 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Varun Davda
Varun Davda
4 years ago

Can you show a example where laravel pagination and Jquery filters both together are implemented?

Andrew Mablekos
Andrew Mablekos
4 years ago

Thank you 🙂

DMCA.com Protection Status
2
0
Would love your thoughts, please comment.x
()
x