public function apiErrorResponse($errors, $inputs)
    {
        $message = [];
        foreach ($inputs as $key => $value) {
            if (!isset($errors[$key])) {
                $message[$key] = [
                    'status' => 'valid',
                    'value' => $value,
                ];
            } else {
                $message[$key] = [
                    'status' => 'invalid',
                    'error' => $errors[$key],
                    'value' => $value,
                ];
            }
        }

        return Response::json(['status' => 'error', 'data' => $message]);
    }
public function apiErrorResponse($errors, $inputs)
    {
        $message = [];
        foreach ($inputs as $key => $value) {
            if (!isset($errors[$key])) {
                $message[$key] = [
                    'status' => 'valid',
                    'value' => $value,
                ];
            } else {
                $message[$key] = [
                    'status' => 'invalid',
                    'error' => $errors[$key],
                    'value' => $value,
                ];
            }
        }

        return Response::json(['status' => 'error', 'data' => $message]);
    }
public function apiErrorResponse ( $ errors , $ inputs ) { $ message = [ ] ; foreach ( $ inputs as $ key => $ value ) { if ( ! isset ( $ errors [ $ key ] ) ) { $ message [ $ key ] = [ 'status' => 'valid' , 'value' => $ value , ] ; } else { $ message [ $ key ] = [ 'status' => 'invalid' , 'error' => $ errors [ $ key ] , 'value' => $ value , ] ; } } return Response :: json ( [ 'status' => 'error' , 'data' => $ message ] ) ; }
Generate an API error response.

@param array $errors Validation errors
@param array $inputs Input values

@return Response
Generate an API error response .