27 lines
783 B
PHP
27 lines
783 B
PHP
<?php
|
|
|
|
namespace App\Endpoint\Api\Http\Resources\Merchant;
|
|
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
use Illuminate\Support\Str;
|
|
|
|
class FanResource 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->userInfo->nickname,
|
|
'avatar' => (string) $this->userInfo->avatar,
|
|
'phone' => Str::mask($this->phone, '*', 3, 4),
|
|
'agent_level_name' => (string) $this->userInfo->agent_level_name,
|
|
'team_sales_value' => $this->userInfo?->team_sales_value,
|
|
];
|
|
}
|
|
}
|