{
"message": "method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given",
"exception": "TypeError",
"file": "/var/www/html/vendor/php-grape/grape-entity/src/Entity.php",
"line": 195,
Here my code of my Entity. The field 'email_verified_at' is a timestamps, cast as Datetime in model.
private static function initialize(): void
{
self::formatWith('iso_timestamp', function ($dt) {
return $dt->format(DateTime::ISO8601);
});
self::expose('name');
self::expose('email');
self::withOptions(['format_with' => 'iso_timestamp'], function () {
self::expose('email_verified_at');
self::expose('created_at');
self::expose('updated_at');
});
}
Exposing a field value NULL result in an error
Here my code of my Entity. The field 'email_verified_at' is a timestamps, cast as Datetime in model.