getRouteKey(); } /** * @param \App\Models\User $resource * the domain record being serialized. * @return array */ public function getAttributes($resource) { return [ 'name' => $resource->name, 'email' => $resource->email, 'createdAt' => $resource->created_at, 'updatedAt' => $resource->updated_at, ]; } }