123456789101112131415161718192021222324252627282930 |
- <?php
- namespace App\Http\Resources;
- use Illuminate\Http\Resources\Json\JsonResource;
- class InviteNewUserResource extends JsonResource
- {
- /**
- * Transform the resource into an array.
- *
- * @param \Illuminate\Http\Request $request
- * @return array
- */
- public function toArray($request)
- {
- $model = $this->resource;
- return [
- 'id' => $model->id,
- 'invite_nickname' => ($model->invite->nickname ??'').'('.($model->invite->truename ?? '').')',
- 'invite_mobile' => $model->invite->mobile ?? '',
- 'register_nickname' => $model->register->nickname ?? '',
- 'register_mobile' => $model->register->mobile ?? '',
- 'is_card_certified' => $model->is_card_certified,
- 'is_first_order' => $model->is_first_order,
- 'status' => $model->status,
- 'created_at' => $model->created_at->format('Y-m-d H:i:s'),
- ];
- }
- }
|