@@ -50,7 +50,7 @@ public function toArray($request)
5050 'jobs ' => $ this ->whenLoaded ('jobs ' , fn () => $ this ->getJobs ()),
5151 'vendor ' => $ this ->whenLoaded ('vendor ' , fn () => new Vendor ($ this ->vendor )),
5252 'fleets ' => $ this ->whenLoaded ('fleets ' , fn () => Fleet::collection ($ this ->fleets ()->without ('drivers ' )->get ())),
53- 'location ' => $ this ->wasRecentlyCreated ? new Point (0 , 0 ) : data_get ($ this , ' location ' , new Point ( 0 , 0 ) ),
53+ 'location ' => $ this ->wasRecentlyCreated ? new Point (0 , 0 ) : Utils:: castPoint ($ this -> location ),
5454 'heading ' => (int ) data_get ($ this , 'heading ' , 0 ),
5555 'altitude ' => (int ) data_get ($ this , 'altitude ' , 0 ),
5656 'speed ' => (int ) data_get ($ this , 'speed ' , 0 ),
@@ -96,7 +96,7 @@ public function toWebhookPayload()
9696 'vehicle ' => data_get ($ this , 'vehicle.public_id ' ),
9797 'current_job ' => data_get ($ this , 'currentJob.public_id ' ),
9898 'vendor ' => data_get ($ this , 'vendor.public_id ' ),
99- 'location ' => data_get ($ this , ' location ' , new Point ( 0 , 0 ) ),
99+ 'location ' => Utils:: castPoint ($ this -> location ),
100100 'heading ' => (int ) data_get ($ this , 'heading ' , 0 ),
101101 'altitude ' => (int ) data_get ($ this , 'altitude ' , 0 ),
102102 'speed ' => (int ) data_get ($ this , 'speed ' , 0 ),
0 commit comments