48 lines
1020 B
PHP
48 lines
1020 B
PHP
<?php
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
/**
|
|
* @OA\Schema(
|
|
* schema="LogResource",
|
|
* type="object",
|
|
* title="Log",
|
|
* description="Log resource",
|
|
* @OA\Property(
|
|
* property="id",
|
|
* type="integer",
|
|
* example=1
|
|
* ),
|
|
* @OA\Property(
|
|
* property="description",
|
|
* type="string",
|
|
* example="User logged in"
|
|
* ),
|
|
* @OA\Property(
|
|
* property="created_at",
|
|
* type="string",
|
|
* format="date-time",
|
|
* example="2025-11-10T17:45:00.000000Z"
|
|
* )
|
|
* )
|
|
*/
|
|
class LogResource extends JsonResource
|
|
{
|
|
/**
|
|
* Transform the resource into an array.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function toArray(Request $request): array
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'description' => $this->description,
|
|
'created_at' => $this->created_at
|
|
];
|
|
}
|
|
}
|