public function toArray()
    {
        $notification = [
            'title' => $this->title,
            'body' => $this->body,
            'android_channel_id' => $this->channelId,
            'icon' => $this->icon,
            'sound' => $this->sound,
            'badge' => $this->badge,
            'tag' => $this->tag,
            'color' => $this->color,
            'click_action' => $this->clickAction,
            'body_loc_key' => $this->bodyLocationKey,
            'body_loc_args' => $this->bodyLocationArgs,
            'title_loc_key' => $this->titleLocationKey,
            'title_loc_args' => $this->titleLocationArgs,
        ];

        // remove null values
        $notification = array_filter($notification);

        return $notification;
    }
public function toArray()
    {
        $notification = [
            'title' => $this->title,
            'body' => $this->body,
            'android_channel_id' => $this->channelId,
            'icon' => $this->icon,
            'sound' => $this->sound,
            'badge' => $this->badge,
            'tag' => $this->tag,
            'color' => $this->color,
            'click_action' => $this->clickAction,
            'body_loc_key' => $this->bodyLocationKey,
            'body_loc_args' => $this->bodyLocationArgs,
            'title_loc_key' => $this->titleLocationKey,
            'title_loc_args' => $this->titleLocationArgs,
        ];

        // remove null values
        $notification = array_filter($notification);

        return $notification;
    }
public function toArray ( ) { $ notification = [ 'title' => $ this -> title , 'body' => $ this -> body , 'android_channel_id' => $ this -> channelId , 'icon' => $ this -> icon , 'sound' => $ this -> sound , 'badge' => $ this -> badge , 'tag' => $ this -> tag , 'color' => $ this -> color , 'click_action' => $ this -> clickAction , 'body_loc_key' => $ this -> bodyLocationKey , 'body_loc_args' => $ this -> bodyLocationArgs , 'title_loc_key' => $ this -> titleLocationKey , 'title_loc_args' => $ this -> titleLocationArgs , ] ; // remove null values $ notification = array_filter ( $ notification ) ; return $ notification ; }
convert PayloadNotification to array.

@return array
convert PayloadNotification to array .