wip
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Api\LoanPaidOffLetterOrder\Resources;
|
||||
|
||||
use App\Repos\Order\OrderRepo;
|
||||
use App\Repos\System\Settings\Location\RegionRepo;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
/**
|
||||
* @mixin \App\Models\Order\Loan\LoanPaidOffLetterOrder
|
||||
*/
|
||||
class LoanPaidOffLetterOrderIndexResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'unique_id' => $this->unique_id,
|
||||
'user_id' => $this->user_id,
|
||||
|
||||
'region' => RegionRepo::label($this->region),
|
||||
'branch_id' => $this->branch?->name,
|
||||
|
||||
'customer_name' => $this->customer_name,
|
||||
'customer_surname' => $this->customer_surname,
|
||||
'customer_patronic_name' => $this->customer_patronic_name,
|
||||
|
||||
'born_at' => $this->born_at,
|
||||
'phone' => $this->phone,
|
||||
'passport_serie' => $this->passport_serie,
|
||||
'passport_id' => $this->passport_id,
|
||||
|
||||
'status' => OrderRepo::statusFormatted($this->status),
|
||||
|
||||
'notes' => $this->notes,
|
||||
|
||||
'loan_contract_number' => $this->loan_contract_number,
|
||||
'loan_contract_date' => $this->loan_contract_date,
|
||||
|
||||
'loan_amount' => $this->loan_amount,
|
||||
'loan_reason' => $this->loan_reason,
|
||||
|
||||
'created_at' => $this->created_at,
|
||||
'updated_at' => $this->updated_at,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user