add controllers, servoices
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources\ExtraCharges;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class ExtraChargeInvoiceOptionResource extends JsonResource
|
||||
{
|
||||
public function toArray($request): array
|
||||
{
|
||||
return [
|
||||
'id' => $this['id'] ?? null,
|
||||
'invoice_number' => $this['invoice_number'] ?? '',
|
||||
'status' => $this['status'] ?? '',
|
||||
'balance' => $this['balance'] ?? 0,
|
||||
'issue_date' => $this['issue_date'] ?? null,
|
||||
'text' => $this['text'] ?? '',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources\ExtraCharges;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class ExtraChargeParentOptionResource extends JsonResource
|
||||
{
|
||||
public function toArray($request): array
|
||||
{
|
||||
return [
|
||||
'id' => $this['id'] ?? null,
|
||||
'text' => $this['text'] ?? '',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources\ExtraCharges;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class ExtraChargeResource extends JsonResource
|
||||
{
|
||||
public function toArray($request): array
|
||||
{
|
||||
$data = is_array($this->resource) ? $this->resource : $this->resource->toArray();
|
||||
|
||||
return [
|
||||
'id' => (int) ($data['id'] ?? 0),
|
||||
'parent_id' => $data['parent_id'] ?? null,
|
||||
'invoice_id' => $data['invoice_id'] ?? null,
|
||||
'school_year' => $data['school_year'] ?? null,
|
||||
'semester' => $data['semester'] ?? null,
|
||||
'charge_type' => $data['charge_type'] ?? null,
|
||||
'title' => $data['title'] ?? null,
|
||||
'description' => $data['description'] ?? null,
|
||||
'amount' => $data['amount'] ?? null,
|
||||
'due_date' => $data['due_date'] ?? null,
|
||||
'status' => $data['status'] ?? null,
|
||||
'created_by' => $data['created_by'] ?? null,
|
||||
'created_at' => $data['created_at'] ?? null,
|
||||
'parent_name' => $data['parent_name'] ?? null,
|
||||
'invoice_number' => $data['invoice_number'] ?? null,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user