update api and add more features
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<?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,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user