finished api

This commit is contained in:
Clément
2025-06-04 19:50:52 +02:00
parent 1551f6226e
commit f488f7e01d
32 changed files with 1078 additions and 30 deletions

View File

@@ -0,0 +1,24 @@
<?php
namespace App\Http\Resources;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class BilletResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @return array<string, mixed>
*/
public function toArray(Request $request): array
{
return [
'Date' => $this->BIL_DATE,
'Titre' => $this->BIL_TITRE,
'Contenu' => $this->BIL_CONTENU,
'Commentaires' => CommentaireResource::collection($this->whenLoaded('commentaires')),
];
}
}