initial commit

This commit is contained in:
bastien
2026-06-28 12:29:53 +02:00
parent 03e85d2f9d
commit b2443b654c
220 changed files with 24969 additions and 1 deletions
+25
View File
@@ -0,0 +1,25 @@
<?php
namespace App\Http\Resources;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class PromotionResource extends JsonResource
{
public function toArray(Request $request): array
{
return [
'id' => $this->id,
'establishment_id' => $this->establishment_id,
'machine_type' => $this->machine_type,
'discount_type' => $this->discount_type,
'discount_value' => (float) $this->discount_value,
'starts_at' => $this->starts_at?->toIso8601String(),
'ends_at' => $this->ends_at?->toIso8601String(),
'description' => $this->description,
'is_active' => $this->is_active,
'establishment' => new EstablishmentResource($this->whenLoaded('establishment')),
];
}
}