27 lines
692 B
PHP
27 lines
692 B
PHP
<?php
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class OperationLogResource 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 [
|
|
'id' => $this->id,
|
|
'user_name' => $this->user_name,
|
|
'type' => $this->type,
|
|
'message' => $this->message,
|
|
'input_data' => $this->input_data,
|
|
'created_at' => strtotime($this->created_at) ?? 0, //录入时间
|
|
];
|
|
}
|
|
}
|