$model->id, 'external_id' => $model->external_id, 'uuid' => $model->uuid, 'username' => $model->username, 'email' => $model->email, 'first_name' => $model->name_first, 'last_name' => $model->name_last, 'language' => $model->language, 'root_admin' => (bool) $model->root_admin, '2fa' => (bool) $model->use_totp, 'avatar_url' => $model->avatarURL(), 'role_name' => $model->roleName(), 'created_at' => $this->formatTimestamp($model->created_at), 'updated_at' => $this->formatTimestamp($model->updated_at), ]; } /** * Return the servers associated with this user. * * @param \Pterodactyl\Models\User $user * * @return \League\Fractal\Resource\Collection|\League\Fractal\Resource\NullResource * * @throws \Illuminate\Contracts\Container\BindingResolutionException * @throws \Pterodactyl\Exceptions\Transformer\InvalidTransformerLevelException */ public function includeServers(User $user) { if (! $this->authorize(AdminAcl::RESOURCE_SERVERS)) { return $this->null(); } $user->loadMissing('servers'); return $this->collection($user->getRelation('servers'), $this->makeTransformer(ServerTransformer::class), 'server'); } }