update
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\DomainFluctuation\App\Http\Resources;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class DomainFluctuationTermResource extends JsonResource
|
||||
{
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'term_name' => $this->term_name,
|
||||
'description' => $this->description,
|
||||
'date_create' => $this->date_create,
|
||||
'user_id' => $this->user_id,
|
||||
'status' => (bool) $this->status,
|
||||
'type' => $this->whenLoaded('type', fn () => $this->type?->type),
|
||||
'fluctuations_count' => $this->when(
|
||||
isset($this->fluctuations_count),
|
||||
fn () => (int) $this->fluctuations_count
|
||||
),
|
||||
'created_at' => $this->created_at,
|
||||
'updated_at' => $this->updated_at,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user