I have implemented in my controller function $request->wantsJson()
and there is content for my JSON output, how can I call json version?
Is there new route needed? Where can I set by call the type should be text/javascript?
My code example:
public function customersList(Request $request) {
if ($request->wantsJson()) {
return response()->json($result);
}
return view('customers/list');
}