Skip to content
This repository has been archived by the owner on Sep 27, 2022. It is now read-only.

Customizing the error format #11

Open
eissasoubhi opened this issue Mar 21, 2018 · 1 comment
Open

Customizing the error format #11

eissasoubhi opened this issue Mar 21, 2018 · 1 comment

Comments

@eissasoubhi
Copy link

Hi,

I want to know where can I find the code that customizes the JSON error from

[{                                        
    "email": [                            
        "The email field is required."    
    ],                                    
    "password": [                         
        "The password field is required." 
    ]                                     
}].                                       

To

[{
    "errors": {
        "email": [
            "field is required."
        ],
        "password": [
            "field is required."
        ]
    }
}]
@SzymonDukla
Copy link

Hi, it's a method respondError() located in App/Http/Controllers/Api/ApiController.php

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants