update warehouse api

This commit is contained in:
edmondlang
2022-04-19 14:57:38 +08:00
parent 7b88fd5c3c
commit eb31291e25
6 changed files with 48 additions and 24 deletions
+2 -1
View File
@@ -16,7 +16,8 @@ class StateResource extends JsonResource
public function toArray($request)
{
$segmentConstant = (array) SegmentConstant::where('reference', SegmentConstants::STATE_RATE)->get()->first()->value;
$segmentConstantObject = SegmentConstant::where('reference', SegmentConstants::STATE_RATE)->get();
$segmentConstant = $segmentConstantObject->isEmpty() ? [] : (array)$segmentConstantObject->first()->value;
return [
'id' => $this->id,