mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/portal.git
synced 2026-09-01 19:04:22 +00:00
update state charges
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use App\Models\SegmentConstant;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
use App\Classes\ValueObjects\Constants\SegmentConstants;
|
||||
|
||||
class StateResource extends JsonResource
|
||||
{
|
||||
@@ -14,10 +15,14 @@ class StateResource extends JsonResource
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
|
||||
$segmentConstant = (array) SegmentConstant::where('reference', SegmentConstants::STATE_RATE)->get()->first()->value;
|
||||
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'name' => $this->name,
|
||||
'country' => $this->country,
|
||||
'stateCharges' => array_key_exists($this->id, $segmentConstant) ? $segmentConstant[$this->id] : null,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user