ProviderBlockedDayResource.php 669 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace App\Http\Resources;
  3. use Illuminate\Http\Request;
  4. use Illuminate\Http\Resources\Json\JsonResource;
  5. class ProviderBlockedDayResource extends JsonResource
  6. {
  7. public function toArray(Request $request): array
  8. {
  9. return [
  10. 'id' => $this->id,
  11. 'provider_id' => $this->provider_id,
  12. 'date' => $this->date?->format('Y-m-d'),
  13. 'period' => $this->period?->value,
  14. 'reason' => $this->reason,
  15. 'init_hour' => $this->init_hour,
  16. 'end_hour' => $this->end_hour,
  17. 'created_at' => $this->created_at,
  18. 'updated_at' => $this->updated_at,
  19. ];
  20. }
  21. }