Laravel: rendering partial views with AJAX requests

Use string method before view file

return (String) view('Company.allUserAjax');

Pass your view to view helper, render it into a variable and return that variable as response to AjAx.

$view=view('your-view-blade');
$view=$view->render();
$responseData->responseSuccess($view);

In callback of your AjAx you can use that rendered HTML, you are free to append that HTML to any element.


You are getting confused.

Laravel is already doing the rendering of the partial. You are calling View::make() and returning the rendered view to $html.

Then you are passing the rendered view to jQuery, which is simply displaying the data given to it - its not doing any of the calculations itself.