Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

lalarukh's avatar

Server is sending parameters to the URL

Server team confirmed the parameters sent by server: "Dec 12 16:41:54 x1 wcron: [-] postNtimes: Posting done, url= b'wubook.revroo.io/push-notification';, params= {'rcode': 1670859713, 'lcode': 1669807740}".

There are 2 params that are sending to my url(rcode, lcode).

The url in which its sending params is "wubook.revroo.io/push-notification", its not like url.com?param1=xxxx&param2=xxxxx. That's why I can't find a function to get or store these parameters receiving on my URL from server.

0 likes
11 replies
lalarukh's avatar

@vincent15000 Its like this: array:3 [ 0 => true, 1 => [] ]

Any function that can store the incoming params from server in my url. HTTP request only deals with manual added params. These params are coming from server. So, I want to store them in variable and then show it.

1 like
vincent15000's avatar

@lalarukh Which HTTP method is used to send you these data ? GET ? POST ? Have you tried a simple $_POST ?

1 like
vincent15000's avatar

@lalarukh You say that the server sends parameters to the URL.

Can you share here all relevant informations ?

Furthermore which server is it ? Do you any documentation which informs you how to retrieve the parameters ?

lalarukh's avatar

@vincent15000 Sorry for not clear information: This is the flow:

1- user adds a booking to the server.

2- everytime server receives a booking it sends a notification [rcode(reservation code), lcode(hotel code)] to the activated URL by us(wubook.revroo.io/push-notification).

3- server sends information like this "Dec 12 16:41:54 x1 wcron: [-] postNtimes: Posting done, url= b'wubook.revroo.io/push-notification';, params= {'rcode': 1670859713, 'lcode': 1669807740}".

Documentation: "Once a new reservation is collected for the property identified with the lcode argument, WooDoo will issue a POST to the relative URL containing two parameters: rcode (the reservation code) and lcode"

https://tdocs.wubook.net/wired/fetch.html#setting-up-the-push-notification

1 like
lalarukh's avatar

@vincent15000 Hey I followed your suggested method. And after event and listener I'm receiving null in my DB.

Web.php:

$router->get('/notification', function () {

$notification = \App\Models\Notification::create();

return view('notification');

});

Notification.php(Model):

class Notification extends Model

{

use  HasFactory;

protected $dispatchesEvents = [

    'created' => PushNotification::class

];

}

PushNotification.php(Event):

public function __construct(Notification $notification)

{
    //
}

EventServiceProvider.php:

PushNotification::class => [

        NotificationListener::class

    ]

NotificationListener.php: public function handle(PushNotification $event)

{

    $response = Http::post('https://wubook.revroo.io/push-notification', []);

    Notification::create([ 

      "data"=>$response . ' - ' . $event->notification->toArray(),

	]);

} 
1 like
vincent15000's avatar

@lalarukh Sorry but it's difficult to help you more concretely because I don't know WooDoo APIs. And I don't understand why you have written all that code about creating a notification.

I had understood that you receive a notification from WooDoo. If it's effectively the case, you should :

  • try to listen to that notification and first of all check if you receive it (with or without data)

  • furthermore I don't see any API credentials, have you put the credentials in the .env file ?

1 like
lalarukh's avatar

@vincent15000 Thanks for considering my code.

I've added that API url in notificationlistener.php code. We can see above.

I am intermediate level of developer in laravel. So, may I know how can I listen to this URL ("https://wubook.revroo.io/push-notification") in my laravel project that whether its receiving or not.

1 like
vincent15000's avatar
Level 63

@lalarukh I'm not sure that you have only a notification URL to consider ... you have probably credentials too.

Once again I don't know WooDoo API. So what I suggest you is for testing purpose in order to check if it works or not.

I would create a test view just for testing if I can connect to the broadcaster.

On that blade view, I would add this JS code.

https://laravel.com/docs/9.x/broadcasting#client-pusher-channels

Sure you have to add the right configuration to the broadcasting configuration file and customize the JS code according to your needs.

I have seen on the website that once you have created a free account, you will have assistance from WooDoo to help you with the API. You should ask them.

1 like

Please or to participate in this conversation.