protected function ajaxResponse($message)
    {
        $request = Request::capture();

        // ajax but not pjax
        if ($request->ajax() && !$request->pjax()) {
            return response()->json([
                'status'  => true,
                'message' => $message,
            ]);
        }

        return false;
    }
protected function ajaxResponse($message)
    {
        $request = Request::capture();

        // ajax but not pjax
        if ($request->ajax() && !$request->pjax()) {
            return response()->json([
                'status'  => true,
                'message' => $message,
            ]);
        }

        return false;
    }
protected function ajaxResponse ( $ message ) { $ request = Request :: capture ( ) ; // ajax but not pjax if ( $ request -> ajax ( ) && ! $ request -> pjax ( ) ) { return response ( ) -> json ( [ 'status' => true , 'message' => $ message , ] ) ; } return false ; }
Get ajax response.

@param string $message

@return bool|\Illuminate\Http\JsonResponse
Get ajax response .