*/ public function toArray($request): array { return [ 'type' => 'users', 'id' => $this->user->id, 'name' => $this->user->name, 'email' => $this->user->email, 'avatar' => $this->user->avatar, 'is_admin' => $this->user->is_admin, 'preferences' => $this->when($this->includePreferences, $this->user->preferences), ]; } }