Path: blob/1.0-develop/app/Transformers/Api/Client/UserTransformer.php
10284 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'username' => $model->username,26'email' => $model->email,27'image' => 'https://gravatar.com/avatar/' . md5(Str::lower($model->email)),28'2fa_enabled' => $model->use_totp,29'created_at' => $model->created_at->toAtomString(),30];31}32}333435