protected function prepareReplacements(Exception $exception)
    {
        // Run parent
        $replacements = parent::prepareReplacements($exception);

        // Format error message field keys
        if ($exception instanceof \Illuminate\Validation\ValidationException) {
            $replacements = $this->formatCaseOfValidationMessages($replacements);
        }

        // Format response object keys
        $updatedFormat = [];
        foreach ($this->format as $key => $value) {
            $updatedFormat[APIBoilerplate::formatKeyCaseAccordingToReponseFormat($key)] = $value;
        }
        $this->format = $updatedFormat;

        return $replacements;
    }
protected function prepareReplacements(Exception $exception)
    {
        // Run parent
        $replacements = parent::prepareReplacements($exception);

        // Format error message field keys
        if ($exception instanceof \Illuminate\Validation\ValidationException) {
            $replacements = $this->formatCaseOfValidationMessages($replacements);
        }

        // Format response object keys
        $updatedFormat = [];
        foreach ($this->format as $key => $value) {
            $updatedFormat[APIBoilerplate::formatKeyCaseAccordingToReponseFormat($key)] = $value;
        }
        $this->format = $updatedFormat;

        return $replacements;
    }
protected function prepareReplacements ( Exception $ exception ) { // Run parent $ replacements = parent :: prepareReplacements ( $ exception ) ; // Format error message field keys if ( $ exception instanceof \ Illuminate \ Validation \ ValidationException ) { $ replacements = $ this -> formatCaseOfValidationMessages ( $ replacements ) ; } // Format response object keys $ updatedFormat = [ ] ; foreach ( $ this -> format as $ key => $ value ) { $ updatedFormat [ APIBoilerplate :: formatKeyCaseAccordingToReponseFormat ( $ key ) ] = $ value ; } $ this -> format = $ updatedFormat ; return $ replacements ; }
Override prepare replacements function to add extra functionality

@param Exception $exception
@return array
Override prepare replacements function to add extra functionality