32 lines
992 B
PHP
32 lines
992 B
PHP
<?php
|
|
|
|
namespace App\Endpoint\Api\Http\Resources\Merchant;
|
|
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class UserInfoResource extends JsonResource
|
|
{
|
|
/**
|
|
* Transform the resource into an array.
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
* @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
|
|
*/
|
|
public function toArray($request)
|
|
{
|
|
return [
|
|
'nickname' => (string) $this->nickname,
|
|
'avatar' => (string) $this->avatar,
|
|
'gender' => (string) $this->gender,
|
|
'birthday' => (string) $this->birthday?->toDateString(),
|
|
'code' => (string) $this->code,
|
|
'points' => (int) $this->points,
|
|
'quota_v2' => $this->quota_v2,
|
|
'quota_v1' => $this->quota_v1,
|
|
'agent_level' => $this->agent_level,
|
|
'agent_level_icon' => $this->agent_level_icon,
|
|
'agent_level_name' => $this->agent_level_name,
|
|
];
|
|
}
|
|
}
|