diff --git a/server/src/Notifications/OrderAssigned.php b/server/src/Notifications/OrderAssigned.php index 119d7575..863efc2d 100644 --- a/server/src/Notifications/OrderAssigned.php +++ b/server/src/Notifications/OrderAssigned.php @@ -86,15 +86,15 @@ public function broadcastOn() public function toArray() { $order = new OrderResource($this->order); - + return [ 'title' => 'New order ' . $this->order->public_id . ' assigned!', - 'body' => $this->order->isScheduled ? 'You have a new order scheduled for ' . $this->order->scheduled_at : 'You have a new order assigned, tap for details.', - 'data' => [ - 'id' => $this->order->public_id, - 'type' => 'order_assigned', - 'order' => $order->toWebhookPayload() - ] + 'body' => $this->order->isScheduled ? 'You have a new order scheduled for ' . $this->order->scheduled_at : 'You have a new order assigned, tap for details.', + 'data' => [ + 'id' => $this->order->public_id, + 'type' => 'order_assigned', + 'order' => $order->toWebhookPayload(), + ], ]; } diff --git a/server/src/Notifications/OrderCanceled.php b/server/src/Notifications/OrderCanceled.php index 27b2e79c..dc5e1af9 100644 --- a/server/src/Notifications/OrderCanceled.php +++ b/server/src/Notifications/OrderCanceled.php @@ -86,15 +86,15 @@ public function broadcastOn() public function toArray() { $order = new OrderResource($this->order); - + return [ 'title' => 'Order ' . $this->order->public_id . ' was canceled', - 'body' => 'Order ' . $this->order->public_id . ' has been canceled.', - 'data' => [ - 'id' => $this->order->public_id, - 'type' => 'order_canceled', - 'order' => $order->toWebhookPayload() - ] + 'body' => 'Order ' . $this->order->public_id . ' has been canceled.', + 'data' => [ + 'id' => $this->order->public_id, + 'type' => 'order_canceled', + 'order' => $order->toWebhookPayload(), + ], ]; } diff --git a/server/src/Notifications/OrderDispatchFailed.php b/server/src/Notifications/OrderDispatchFailed.php index ed7f27e3..6fb8bd1b 100644 --- a/server/src/Notifications/OrderDispatchFailed.php +++ b/server/src/Notifications/OrderDispatchFailed.php @@ -2,8 +2,8 @@ namespace Fleetbase\FleetOps\Notifications; -use Fleetbase\FleetOps\Http\Resources\v1\Order as OrderResource; use Fleetbase\FleetOps\Events\OrderDispatchFailed as OrderDispatchFailedEvent; +use Fleetbase\FleetOps\Http\Resources\v1\Order as OrderResource; use Fleetbase\FleetOps\Models\Order; use Fleetbase\FleetOps\Support\Utils; use Illuminate\Broadcasting\Channel; @@ -90,15 +90,15 @@ public function via($notifiable) public function toArray() { $order = new OrderResource($this->order); - + return [ 'title' => 'Order ' . $this->order->public_id . ' has dispatch has failed!', - 'body' => $this->reason, - 'data' => [ - 'id' => $this->order->public_id, - 'type' => 'order_dispatch_failed', - 'order' => $order->toWebhookPayload() - ] + 'body' => $this->reason, + 'data' => [ + 'id' => $this->order->public_id, + 'type' => 'order_dispatch_failed', + 'order' => $order->toWebhookPayload(), + ], ]; } diff --git a/server/src/Notifications/OrderDispatched.php b/server/src/Notifications/OrderDispatched.php index a83b2639..d5de41ef 100644 --- a/server/src/Notifications/OrderDispatched.php +++ b/server/src/Notifications/OrderDispatched.php @@ -100,15 +100,15 @@ public function broadcastOn() public function toArray() { $order = new OrderResource($this->order); - + return [ 'title' => 'Order ' . $this->order->public_id . ' has been dispatched!', - 'body' => 'An order has just been dispatched to you and is ready to be started.', - 'data' => [ - 'id' => $this->order->public_id, - 'type' => 'order_dispatched', - 'order' => $order->toWebhookPayload() - ] + 'body' => 'An order has just been dispatched to you and is ready to be started.', + 'data' => [ + 'id' => $this->order->public_id, + 'type' => 'order_dispatched', + 'order' => $order->toWebhookPayload(), + ], ]; } diff --git a/server/src/Notifications/OrderPing.php b/server/src/Notifications/OrderPing.php index f460a4e3..c73ec3cc 100644 --- a/server/src/Notifications/OrderPing.php +++ b/server/src/Notifications/OrderPing.php @@ -103,15 +103,15 @@ public function broadcastOn() public function toArray() { $order = new OrderResource($this->order); - + return [ 'title' => 'New incoming order!', - 'body' => $this->distance ? 'New order available for pickup about ' . Utils::formatMeters($this->distance, false) . ' away' : 'New order is available for pickup.', - 'data' => [ - 'id' => $this->order->public_id, - 'type' => 'order_ping', - 'order' => $order->toWebhookPayload() - ] + 'body' => $this->distance ? 'New order available for pickup about ' . Utils::formatMeters($this->distance, false) . ' away' : 'New order is available for pickup.', + 'data' => [ + 'id' => $this->order->public_id, + 'type' => 'order_ping', + 'order' => $order->toWebhookPayload(), + ], ]; }