public static function send_order_notification($order) { $order= Order::where('id',$order->id)->with('zone:id,deliveryman_wise_topic','restaurant:id,name,restaurant_model,self_delivery_system,vendor_id','restaurant.restaurant_sub','customer:id,cm_firebase_token,email,f_name,l_name,current_language_key','restaurant.vendor:id,firebase_token','delivery_man:id,fcm_token','guest')->first(); $push_notification_status=self::getNotificationStatusData('restaurant','restaurant_order_notification'); $restaurant_push_notification_status=self::getRestaurantNotificationStatusData($order?->restaurant?->id,'restaurant_order_notification'); try { $status = ($order->order_status == 'delivered' && $order->delivery_man) ? 'delivery_boy_delivered' : $order->order_status; if( $order->checked != 1 && ( $order->subscription_id == null && (in_array($order->payment_method, ['cash_on_delivery', 'offline_payment']) && $order->order_status == 'pending' )||(!in_array($order->payment_method, ['cash_on_delivery', 'offline_payment']) && $order->order_status == 'confirmed' )) ){ $data = [ 'title' => translate('messages.order_push_title'), 'description' => translate('messages.new_order_push_description'), 'order_id' => $order->id, 'image' => '', 'type' => 'new_order_admin', ]; self::send_push_notif_to_topic($data, 'admin_message', 'order_request', url('/').'/admin/order/list/all'); }