mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-13 20:18:23 +08:00
28 lines
699 B
PHP
28 lines
699 B
PHP
<?php
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class RewardResource extends JsonResource
|
|
{
|
|
/**
|
|
* Transform the resource into an array.
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
* @return array
|
|
*/
|
|
public function toArray($request)
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'user_id' => $this->userid,
|
|
'torrent_id' => $this->torrentid,
|
|
'value' => $this->value,
|
|
'created_at' => format_datetime($this->created_at),
|
|
'updated_at' => format_datetime($this->updated_at),
|
|
'user' => new UserResource($this->whenLoaded('user'))
|
|
];
|
|
}
|
|
}
|