marcreichel / igdb-laravel

Simplify the integration of the IGDB API into your Laravel app. Including IGDB webhook support.
https://marcreichel.dev/docs/igdb-laravel
MIT License
104 stars 22 forks source link

Webhooks CLI not working #49

Closed adzay closed 2 years ago

adzay commented 2 years ago

Hi the webhooks CLI isnt creating any webhooks.

Please see my screenshot below:

image

marcreichel commented 2 years ago

May I ask you to verify you can create webhooks via Postman (for example) following the official IGDB docs?

Just to make sure it is not a problem with your Client-ID/Account.

marcreichel commented 2 years ago

And another question: Can you create webhooks via code (Game::createWebhook(Method::CREATE) for example)?

marcreichel commented 2 years ago

Do you work on windows? Just checking with a friend and he's on windows as well and has the same problem whereas for me on macOS it's working fine.

adzay commented 2 years ago

Hi I am on mac.

I am implementing this locally on localhost, before i move my changes to production. Could this be why?

Post man works, but only if i put in the live address, not localhost.

Is there a way for me to control/edit the base address for the "url" parameter that is sent to igdb/com/v4/ENDPOINT/webhooks? So i can use the live address whilst making changes locally

marcreichel commented 2 years ago

Yeah, I came to the same result. localhost is the problem. Which makes sense of course. I may need to add proper "error reporting" for this scenario and add an info in the docs.

The APP_URL in your .env is used to generate this URL so changing it from APP_URL=http://localhost to something different resolves the problem (for the CLI). When creating webhooks via browser, the host in your URL bar is used.

adzay commented 2 years ago

Thanks, I updated the APP_URL in .env and it works now.