6
0
Fork 0
jiqu-library-server/app/Endpoint/Api/Http/Resources/Dealer/UserResource.php

27 lines
727 B
PHP

<?php
namespace App\Endpoint\Api\Http\Resources\Dealer;
use Illuminate\Http\Resources\Json\JsonResource;
class UserResource 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 [
'id' => $this->id,
'phone' => $this->phone,
'nickname' => (string) $this->userInfo->nickname,
'avatar' => (string) $this->userInfo->avatar,
'gender' => (string) $this->userInfo->gender,
'code' => (string) $this->userInfo->code,
];
}
}