Path: blob/1.0-develop/app/Transformers/Api/Client/UserTransformer.php
14044 views
<?php12namespace Pterodactyl\Transformers\Api\Client;34use Illuminate\Support\Str;5use Pterodactyl\Models\User;67class UserTransformer extends BaseClientTransformer8{9/**10* Return the resource name for the JSONAPI output.11*/12public function getResourceName(): string13{14return User::RESOURCE_NAME;15}1617/**18* Transforms a User model into a representation that can be shown to regular19* users of the API.20*/21public function transform(User $model): array22{23return [24'uuid' => $model->uuid,25'identifier' => $model->identifier,26'username' => $model->username,27'email' => $model->email,28'image' => 'https://gravatar.com/avatar/' . md5(Str::lower($model->email)),29'2fa_enabled' => $model->use_totp,30'created_at' => $model->created_at->toAtomString(),31];32}33}343536