src/Main.php
public function respondWithResult( $data = NULL ) {

		$res[ 'status' ] = $this->getStatusText();

		//if it's about laravel validation error
		if ( $this->getErrorCode() && $this->getStatusCode() == 420 ) {

			$res[ 'error' ] = $this->getErrorCode();
			$res[ 'message' ] = $data;

		} else {

			$res[ 'result' ] = $data;

		}

		return $this->respond( $res );

	}
public function respondWithResult( $data = NULL ) {

		$res[ 'status' ] = $this->getStatusText();

		//if it's about laravel validation error
		if ( $this->getErrorCode() && $this->getStatusCode() == 420 ) {

			$res[ 'error' ] = $this->getErrorCode();
			$res[ 'message' ] = $data;

		} else {

			$res[ 'result' ] = $data;

		}

		return $this->respond( $res );

	}
public function respondWithResult ( $ data = NULL ) { $ res [ 'status' ] = $ this -> getStatusText ( ) ; //if it's about laravel validation error if ( $ this -> getErrorCode ( ) && $ this -> getStatusCode ( ) == 420 ) { $ res [ 'error' ] = $ this -> getErrorCode ( ) ; $ res [ 'message' ] = $ data ; } else { $ res [ 'result' ] = $ data ; } return $ this -> respond ( $ res ) ; }
Response which contains status and data
@param null|array $data
@author Shima Payro <sh.payro@anetwork.ir>
@since May 2, 2016 9:50:19 AM
@return Main|\Illuminate\Http\JsonResponse
@uses
@see
Response which contains status and data