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

24 lines
833 B
PHP

<?php
namespace App\Http\Resources\Promotions;
use Illuminate\Http\Resources\Json\JsonResource;
class LevelProgressionResource extends JsonResource
{
public function toArray($request): array
{
return [
'id' => (int) ($this->id ?? 0),
'current_level_id' => $this->current_level_id !== null ? (int) $this->current_level_id : null,
'current_level_name' => (string) ($this->current_level_name ?? ''),
'next_level_id' => $this->next_level_id !== null ? (int) $this->next_level_id : null,
'next_level_name' => $this->next_level_name,
'order_index' => (int) ($this->order_index ?? 0),
'is_terminal' => (bool) $this->is_terminal,
'is_active' => (bool) $this->is_active,
'notes' => $this->notes,
];
}
}