app/maguttiCms/Tools/JsonApiResponseTrait.php
/**
     * Return the  json response
     * @return \Illuminate\Http\JsonResponse
     */
Return the  json response
@return \Illuminate\Http\JsonResponse
Return the json response @return \ Illuminate \ Http \ JsonResponse
public function apiResponse()
    {
        $result = [];
        if ($this->id != '') {
            $result['data']['id'] = $this->id;
        }
        $result['data']['type'] = $this->getType();
        if ($this->getAttributes()) {
            $result['data']['attributes'] = $this->getAttributes();
        }
        return response()->json($result, $this->getHttpStatus());
    }
public function apiResponse ( ) { $ result = [ ] ; if ( $ this -> id != '' ) { $ result [ 'data' ] [ 'id' ] = $ this -> id ; } $ result [ 'data' ] [ 'type' ] = $ this -> getType ( ) ; if ( $ this -> getAttributes ( ) ) { $ result [ 'data' ] [ 'attributes' ] = $ this -> getAttributes ( ) ; } return response ( ) -> json ( $ result , $ this -> getHttpStatus ( ) ) ; }
Return the  json response
 @return \Illuminate\Http\JsonResponse
Return the json response @return \ Illuminate \ Http \ JsonResponse