Files
alrahma_sunday_school_api/app/Http/Resources/Promotions/PromotionReminderResource.php
T
2026-06-04 02:24:41 -04:00

25 lines
824 B
PHP

<?php
namespace App\Http\Resources\Promotions;
use Illuminate\Http\Resources\Json\JsonResource;
class PromotionReminderResource extends JsonResource
{
public function toArray($request): array
{
return [
'id' => (int) ($this->id ?? 0),
'promotion_id' => (int) ($this->promotion_id ?? 0),
'student_id' => $this->student_id ? (int) $this->student_id : null,
'parent_id' => $this->parent_id ? (int) $this->parent_id : null,
'reminder_type' => $this->reminder_type,
'channel' => $this->channel,
'subject' => $this->subject,
'message' => $this->message,
'sent_at' => optional($this->sent_at)->toDateTimeString(),
'sent_by' => $this->sent_by ? (int) $this->sent_by : null,
];
}
}