prwnr / laravel-streamer

Events streaming package for Laravel based on Redis Streams
97 stars 12 forks source link

PHP 8.2 support for Laravel 11? #61

Closed sfraysse closed 6 months ago

sfraysse commented 6 months ago

Hi,

First of all, thank you for all your work!

I am currently migrating to Laravel 11, which seams to be supported by laravel-streamer version 4.0. However, in composer.json Laravel 11 requires PHP ^8.2 and laravel-streamer requires PHP ^8.1, so I can't install the package.

Does that mean that your package does not currently support PHP 8.2, or should ^8.2 be added to your composer.json file?

prwnr commented 6 months ago

@sfraysse well, I still have a support for Laravel 10, which is set at minimum 8.1, that's why I left 8.1 in my composer.json, to comply with it, but I thought it will also work fine for 8.2 installations. But I did not install it yet on Laravel 11 as my company is still using Laravel 9.

The code will work with 8.2, cause locally I am using an image of PHP8.2 and my tests matrix tests on 8.2 as well. I didn't complain in tests tho, see https://github.com/prwnr/laravel-streamer/actions/runs/8301800750/job/22722721902#step:7:30 - where it installs Laravel 11 packages without a problem.

Probably the problem is that the composer.json of Laravel application requires 8.2.

I could add 8.2 to the composer.json, but honestly, I am not sure how the duality of versions (^8.1|^8.2) will work here for the PHP requirements. I will create a branch with this change for you to test out, if you don't mind?

prwnr commented 6 months ago

Linked a PR to this issue with the composer.json change

sfraysse commented 6 months ago

Hi @prwnr, I tested your PR and that's OK, this removed the PHP requirement conflict with Laravel 11. I also tested your package in my application with Redis 5, 6 and 7 and it worked like a charm!