lmsqueezy / laravel

A package to easily integrate your Laravel application with Lemon Squeezy.
https://lemonsqueezy.com
MIT License
468 stars 47 forks source link

Undefined constant "LemonSqueezy\Laravel\Console\SIGINT" #94

Closed smell-of-curry closed 1 week ago

smell-of-curry commented 2 weeks ago

Lemon Squeezy for Laravel Version

1.5.4

Laravel Version

10.48.7

PHP Version

8.1

Description

Im running php artisan lmsqueezy:listen and choosing expose and it says:

Error

  Undefined constant "LemonSqueezy\Laravel\Console\SIGINT"

  at vendor\lemonsqueezy\laravel\src\Console\ListenCommand.php:144
    140▕     protected function handleService(): int
    141▕     {
    142▕         note('Setting up webhooks domain with '.$this->argument('service').'...');
    143▕
  ➜ 144▕         $this->trap([SIGINT], fn (int $signal) => $this->teardownWebhook());
    145▕
    146▕         return $this->{$this->argument('service')}();
    147▕     }
    148▕

  1   vendor\lemonsqueezy\laravel\src\Console\ListenCommand.php:83
      LemonSqueezy\Laravel\Console\ListenCommand::handleService()

  2   vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:36
      LemonSqueezy\Laravel\Console\ListenCommand::handle()

image

Steps To Reproduce

Fresh Install, run php artisan lmsqueezy:listen

Afan417 commented 1 week ago

I am experiencing the same issue, in Windows 10 x64 bit, any help?

heyjorgedev commented 1 week ago

I believe PHP doesn't support signal handling on Windows. Therefore SIGINT is not an available constant.

@driesvints @DanielHudson maybe we could add a check to validate the command is being run on windows and provide this information as a console output and possible solutions?

driesvints commented 1 week ago

Thanks for reporting this one. Unfortunately the listen command cannot be used on windows due to the lack of signal handling on Windows. I've now added a warning to the command. Right now I don't have plans to develop support for Windows for this command but I'd very much accept PR's that could help out.