$request = AphrontRequest::getHttpRequest(); $is_ajax = $request->isAjax(); if ($is_ajax) { // request was made with AJAX }
$request = AphrontRequest::getHttpRequest(); $is_ajax = $request->isAjax(); if ($is_ajax) { header('Content-Type: application/json'); echo json_encode(['success' => true]); exit; }
use AphrontRequest; var_dump(new AphrontRequest());This code creates a new instance of AphrontRequest and outputs its properties and methods to the screen. By examining the output, you can determine which package the AphrontRequest class belongs to.