What is User; does it extend \Illuminate\Database\Eloquent\Model (via the \Illuminate\Foundation\Auth\User class)?
Is the firstOrFail method being overridden somewhere in that class hierarchy?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Dear Guys, I didn't get any exception message . what is the reason behind of it ? please help me
Please note: ID is not available on my database . its fake one.
Controller Class
var_dump(User::findOrFail(21)); //returns NULL
API Response
POST http://127.0.0.1:8000/api/auth/register
HTTP/1.1 200 OK
Host: 127.0.0.1:8000
Date: Fri, 04 Feb 2022 14:32:29 GMT
Connection: close
X-Powered-By: PHP/8.0.13
Content-Type: text/html; charset=UTF-8
Cache-Control: no-cache, private
Date: Fri, 04 Feb 2022 14:32:29 GMT
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 59
Access-Control-Allow-Origin: *
NULL
Response code: 200 (OK); Time: 201ms; Content length: 5 bytes
Please or to participate in this conversation.