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