how to check if a request is ajax larave in routes code example
Example: laravel check request is ajax
/**
* Display a listing of the resource.
*
* @param Illuminate\Http\Request $request
* @return Response
*/
public function index(Request $request)
{
if($request->ajax()){
return "AJAX";
}
return "HTTP";
}