first
This commit is contained in:
26
modules/User/Http/Resources/UserInfoBaseResource.php
Normal file
26
modules/User/Http/Resources/UserInfoBaseResource.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\User\Http\Resources;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class UserInfoBaseResource extends JsonResource
|
||||
{
|
||||
|
||||
public function toArray($request): array
|
||||
{
|
||||
return [
|
||||
'user_id' => $this->id,
|
||||
'username' => $this->username,
|
||||
'nickname' => $this->info->nickname ?? '',
|
||||
'avatar' => $this->info->avatar ?? '',
|
||||
'sign' => $this->getSignData(),
|
||||
'identity' => new UserIdentityBaseResource($this->identities->first()),
|
||||
'status' => $this->getStateData(),
|
||||
'canPick' => $this->canPick(),
|
||||
'nowStatus' => $this->getNowStatus(),
|
||||
'tag' => $this->tag
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user