generated from panliang/owl-admin-starter
37 lines
1.1 KiB
PHP
37 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class UserScoreResource extends JsonResource
|
|
{
|
|
/**
|
|
* Transform the resource into an array.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function toArray(Request $request): array
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'type_id' => $this->type_id,
|
|
'type' => $this->whenLoaded('type'),
|
|
'cate_id' => $this->cate_id,
|
|
'user_id' => $this->user_id,
|
|
'title' => $this->title,
|
|
'content' => $this->content,
|
|
'images' => $this->images,
|
|
'file' => $this->file,
|
|
'check_status' => $this->check_status,
|
|
'check_user' => $this->whenLoaded('checkUser'),
|
|
'check_status_text' => $this->check_status_text,
|
|
'check_remarks' => $this->check_remarks,
|
|
'check_at' => $this->check_at?->format('Y-m-d H:i:s'),
|
|
'score' => $this->score,
|
|
'created_at' => $this->created_at->format('Y-m-d H:i:s')
|
|
];
|
|
}
|
|
}
|