• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.