mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/portal.git
synced 2026-08-25 23:44:14 +00:00
Initial commit
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use App\Classes\ValueObjects\Constants\AccountStatus;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class CompanyResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'account_no' => $this->reference_no,
|
||||
'name' => $this->name,
|
||||
'type' => $this->type,
|
||||
'status' => AccountStatus::STATUS[$this->status],
|
||||
'delivery_address' => new AddressResource($this->deliveryAddress)
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user