12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- namespace App\Http\Resources;
- use App\Models\Area;
- use App\Models\User;
- use Illuminate\Http\Resources\Json\JsonResource;
- class StudentResource extends JsonResource
- {
- /**
- * Transform the resource into an array.
- *
- * @param \Illuminate\Http\Request $request
- * @return array
- */
- public function toArray($request)
- {
- $model = $this->resource;
- // $data = [
- // 'id' => $model->id,
- // 'nickname' => $model->user->nickname,
- // 'realName' => $model->user->truename,
- // 'avatar' => $model->user->avatar,
- // 'mobile' => $model->user->mobile,
- // 'idCard' => $model->user->idCard,
- // 'is_card_certified' => $model->user->is_card_certified,
- // 'register_area_id' => $model->user->register_area_id,
- // 'name' => $model->name,
- // 'type' => $model->type,
- // 'student_no' => $model->student_no,
- // 'year' => $model->year,
- // 'imgs' => $model->imgs,
- // 'auth_status' => $model->auth_status,
- // 'error_msg' => $model->error_msg,
- // 'admin_id' => $model->admin_id,
- // 'status' => $model->status,
- // 'created_at' => $model->created_at,
- // 'updated_at' => $model->updated_at
- // ];
- $data = [
- ];
- return array_merge(parent::toArray($request), $data);
- }
- }
|