Welcome Guest, Not a member yet? Register   Sign In
validationRules returns Internal Server Error in CI4
#1

Hello, 

Having a small problem. I'm trying to build an API and when I setup the "protected $validationRules" I get the following error: 
{
    "status"500,
    "error"500,
    "messages": {
        "error""Internal Server Error"
    }
}


The code is: 

PHP Code:
protected $validationRules = [
        'email' => 'required|valid_email',
        'first_name' => 'required'
    ]; 

In postman I'm using an incorect email format. Same thing happens also if I don't put "first_name". 

So my issue it's not that I'm getting an error, that's what I'm looking to get ... but I'm looking to get "Invalid Email address" ... not "Internal Server Error" 

If anyone can help ... would be much appreciated. 
Reply
#2

Solved it ... obvious my mistake I was showing the error from $this instead of $model->errors()
Reply




Theme © iAndrew 2016 - Forum software by © MyBB