src/APIResponse.php
public function respondWithError($message = "Error", $e = null, $data = null)
    {
        $response = null;
        if (\App::environment('local', 'staging') && isset($e)) {
            $debug_message = $e;
            $data = $this->getResponseStructure(false, $data, $message, $debug_message);
        } else {
            $data = $this->getResponseStructure(false, $data, $message);
        }

        $response = $this->respond($data);

        return $response;
    }
public function respondWithError($message = "Error", $e = null, $data = null)
    {
        $response = null;
        if (\App::environment('local', 'staging') && isset($e)) {
            $debug_message = $e;
            $data = $this->getResponseStructure(false, $data, $message, $debug_message);
        } else {
            $data = $this->getResponseStructure(false, $data, $message);
        }

        $response = $this->respond($data);

        return $response;
    }
public function respondWithError ( $ message = "Error" , $ e = null , $ data = null ) { $ response = null ; if ( \ App :: environment ( 'local' , 'staging' ) && isset ( $ e ) ) { $ debug_message = $ e ; $ data = $ this -> getResponseStructure ( false , $ data , $ message , $ debug_message ) ; } else { $ data = $ this -> getResponseStructure ( false , $ data , $ message ) ; } $ response = $ this -> respond ( $ data ) ; return $ response ; }
Responds with error

@param string $message
@param null   $e
@param null   $data

@return JsonResponse|null
Responds with error