The view()
function just creates an instance of the View
class. Not just an HTML string. For that you should call render()
:
$returnHTML = view('job.userjobs')->with('userjobs', $userjobs)->render();
return response()->json(array('success' => true, 'html'=>$returnHTML));