From a0378457ec859c3a4afd0e01854d22b6c315f3f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Dalmolin?= Date: Fri, 23 Jan 2026 08:19:34 -0300 Subject: [PATCH 1/5] Added Filament 5 support --- composer.json | 11 ++++++----- src/CommentionsServiceProvider.php | 24 +++++++++++++++++++----- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/composer.json b/composer.json index 2c5aa45..51d12ba 100644 --- a/composer.json +++ b/composer.json @@ -25,10 +25,10 @@ "league/html-to-markdown": "^5.1", "illuminate/support": "^11.0|^12.0", "illuminate/database": "^11.0|^12.0", - "livewire/livewire": "^3.5", - "filament/support": "^3.2|^4.0", - "filament/notifications": "^3.2|^4.0", - "filament/filament": "^3.2|^4.0" + "livewire/livewire": "^3.5|^4.0", + "filament/support": "^3.2|^4.0|^5.0", + "filament/notifications": "^3.2|^4.0|^5.0", + "filament/filament": "^3.2|^4.0|^5.0" }, "extra": { "laravel": { @@ -44,7 +44,8 @@ "pestphp/pest-plugin-laravel": "^3.1", "pestphp/pest-plugin-livewire": "^3.0", "laravel/pint": "^1.21", - "larastan/larastan": "^3.0" + "larastan/larastan": "^3.0", + "filament/upgrade": "^5.0" }, "config": { "allow-plugins": { diff --git a/src/CommentionsServiceProvider.php b/src/CommentionsServiceProvider.php index 4dc3b75..604b0ea 100644 --- a/src/CommentionsServiceProvider.php +++ b/src/CommentionsServiceProvider.php @@ -7,6 +7,7 @@ use Filament\Support\Facades\FilamentAsset; use Illuminate\Support\Facades\Event; use Illuminate\Support\Facades\Gate; +use Composer\InstalledVersions; use Kirschbaum\Commentions\Comment as CommentModel; use Kirschbaum\Commentions\Events\UserWasMentionedEvent; use Kirschbaum\Commentions\Listeners\SendUserMentionedNotification; @@ -44,11 +45,15 @@ public function configurePackage(Package $package): void public function packageBooted(): void { - Livewire::component('commentions::comment', Comment::class); - Livewire::component('commentions::comment-list', CommentList::class); - Livewire::component('commentions::comments', Comments::class); - Livewire::component('commentions::reactions', Reactions::class); - Livewire::component('commentions::subscription-sidebar', SubscriptionSidebar::class); + if ($this->isLivewireV4()) { + Livewire::addNamespace('commentions', classNamespace: __NAMESPACE__ . '\\Livewire'); + } else { + Livewire::component('commentions::comment', Comment::class); + Livewire::component('commentions::comment-list', CommentList::class); + Livewire::component('commentions::comments', Comments::class); + Livewire::component('commentions::reactions', Reactions::class); + Livewire::component('commentions::subscription-sidebar', SubscriptionSidebar::class); + } FilamentAsset::register( [ @@ -76,4 +81,13 @@ public function packageBooted(): void Event::listen(UserWasMentionedEvent::class, $listenerClass); } } + + protected function isLivewireV4(): bool + { + return version_compare( + InstalledVersions::getVersion('livewire/livewire') ?? '0.0', + '4.0', + '>=' + ); + } } From 4e37a24f95bbecb60d7905ccb330a9da15f35f0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Dalmolin?= Date: Fri, 23 Jan 2026 08:20:32 -0300 Subject: [PATCH 2/5] Add Filament 5 and Livewire 4 support to CI workflow --- .github/workflows/ci.yml | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b8f84f0..962ebf1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,8 @@ jobs: php: 8.4 laravel: 12 testbench: 10 - filament: 4 + filament: 5 + livewire: 4 larastan: 3 pint: 1 @@ -43,6 +44,8 @@ jobs: composer --version composer require "laravel/framework:${{ env.laravel }}.*" --no-interaction --no-update composer require "orchestra/testbench:${{ env.testbench }}.*" --no-interaction --no-update --dev + composer require "filament/filament:${{ env.filament }}.*" --no-interaction --no-update + composer require "livewire/livewire:${{ env.livewire }}.*" --no-interaction --no-update composer require "larastan/larastan:${{ env.larastan }}.*" --no-interaction --no-update --dev composer require "laravel/pint:${{ env.pint }}.*" --no-interaction --no-update --dev composer update --prefer-dist --no-interaction @@ -59,7 +62,8 @@ jobs: php: 8.4 laravel: 12 testbench: 10 - filament: 4 + filament: 5 + livewire: 4 larastan: 3 pint: 1 @@ -89,6 +93,8 @@ jobs: composer --version composer require "laravel/framework:${{ env.laravel }}.*" --no-interaction --no-update composer require "orchestra/testbench:${{ env.testbench }}.*" --no-interaction --no-update --dev + composer require "filament/filament:${{ env.filament }}.*" --no-interaction --no-update + composer require "livewire/livewire:${{ env.livewire }}.*" --no-interaction --no-update composer require "larastan/larastan:${{ env.larastan }}.*" --no-interaction --no-update --dev composer require "laravel/pint:${{ env.pint }}.*" --no-interaction --no-update --dev composer update --prefer-dist --no-interaction --no-suggest --dev @@ -108,19 +114,25 @@ jobs: matrix: php: [8.3, 8.4] laravel: [11, 12] + filament: [4, 5] + exclude: + - laravel: 11 + filament: 5 include: - laravel: 11 testbench: 9 - filament: 4 larastan: 3 pint: 1 - laravel: 12 testbench: 10 - filament: 4 larastan: 3 pint: 1 + - filament: 4 + livewire: 3 + - filament: 5 + livewire: 4 - name: Tests - PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} + name: Tests - PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - Filament ${{ matrix.filament }} steps: - name: Checkout code uses: actions/checkout@v4 @@ -146,6 +158,8 @@ jobs: composer --version composer require "laravel/framework:${{ matrix.laravel }}.*" --no-interaction --no-update composer require "orchestra/testbench:${{ matrix.testbench }}.*" --no-interaction --no-update --dev + composer require "filament/filament:${{ matrix.filament }}.*" --no-interaction --no-update + composer require "livewire/livewire:${{ matrix.livewire }}.*" --no-interaction --no-update composer require "larastan/larastan:${{ matrix.larastan }}.*" --no-interaction --no-update --dev composer require "laravel/pint:${{ matrix.pint }}.*" --no-interaction --no-update --dev composer update --prefer-dist --no-interaction --no-suggest --dev From 0998d5917a6614b850c332d8c79a6f13626af443 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Dalmolin?= Date: Fri, 23 Jan 2026 08:21:33 -0300 Subject: [PATCH 3/5] Add support for pest-plugin-livewire v4 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 51d12ba..1e84a8b 100644 --- a/composer.json +++ b/composer.json @@ -42,7 +42,7 @@ "illuminate/auth": "^11.0|^12.0", "orchestra/testbench": "^9.9|^10.0", "pestphp/pest-plugin-laravel": "^3.1", - "pestphp/pest-plugin-livewire": "^3.0", + "pestphp/pest-plugin-livewire": "^3.0|^4.0", "laravel/pint": "^1.21", "larastan/larastan": "^3.0", "filament/upgrade": "^5.0" From 5835a2a0bbffe6b7177478f73eadadbad64f48ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Dalmolin?= Date: Fri, 23 Jan 2026 08:23:15 -0300 Subject: [PATCH 4/5] Add pest 4 support for Livewire 4 testing --- .github/workflows/ci.yml | 13 +++++++++++++ composer.json | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 962ebf1..9c81a59 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,6 +15,7 @@ jobs: testbench: 10 filament: 5 livewire: 4 + pest: 4 larastan: 3 pint: 1 @@ -46,6 +47,9 @@ jobs: composer require "orchestra/testbench:${{ env.testbench }}.*" --no-interaction --no-update --dev composer require "filament/filament:${{ env.filament }}.*" --no-interaction --no-update composer require "livewire/livewire:${{ env.livewire }}.*" --no-interaction --no-update + composer require "pestphp/pest:${{ env.pest }}.*" --no-interaction --no-update --dev + composer require "pestphp/pest-plugin-laravel:${{ env.pest }}.*" --no-interaction --no-update --dev + composer require "pestphp/pest-plugin-livewire:${{ env.pest }}.*" --no-interaction --no-update --dev composer require "larastan/larastan:${{ env.larastan }}.*" --no-interaction --no-update --dev composer require "laravel/pint:${{ env.pint }}.*" --no-interaction --no-update --dev composer update --prefer-dist --no-interaction @@ -64,6 +68,7 @@ jobs: testbench: 10 filament: 5 livewire: 4 + pest: 4 larastan: 3 pint: 1 @@ -95,6 +100,9 @@ jobs: composer require "orchestra/testbench:${{ env.testbench }}.*" --no-interaction --no-update --dev composer require "filament/filament:${{ env.filament }}.*" --no-interaction --no-update composer require "livewire/livewire:${{ env.livewire }}.*" --no-interaction --no-update + composer require "pestphp/pest:${{ env.pest }}.*" --no-interaction --no-update --dev + composer require "pestphp/pest-plugin-laravel:${{ env.pest }}.*" --no-interaction --no-update --dev + composer require "pestphp/pest-plugin-livewire:${{ env.pest }}.*" --no-interaction --no-update --dev composer require "larastan/larastan:${{ env.larastan }}.*" --no-interaction --no-update --dev composer require "laravel/pint:${{ env.pint }}.*" --no-interaction --no-update --dev composer update --prefer-dist --no-interaction --no-suggest --dev @@ -129,8 +137,10 @@ jobs: pint: 1 - filament: 4 livewire: 3 + pest: 3 - filament: 5 livewire: 4 + pest: 4 name: Tests - PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - Filament ${{ matrix.filament }} steps: @@ -160,6 +170,9 @@ jobs: composer require "orchestra/testbench:${{ matrix.testbench }}.*" --no-interaction --no-update --dev composer require "filament/filament:${{ matrix.filament }}.*" --no-interaction --no-update composer require "livewire/livewire:${{ matrix.livewire }}.*" --no-interaction --no-update + composer require "pestphp/pest:${{ matrix.pest }}.*" --no-interaction --no-update --dev + composer require "pestphp/pest-plugin-laravel:${{ matrix.pest }}.*" --no-interaction --no-update --dev + composer require "pestphp/pest-plugin-livewire:${{ matrix.pest }}.*" --no-interaction --no-update --dev composer require "larastan/larastan:${{ matrix.larastan }}.*" --no-interaction --no-update --dev composer require "laravel/pint:${{ matrix.pint }}.*" --no-interaction --no-update --dev composer update --prefer-dist --no-interaction --no-suggest --dev diff --git a/composer.json b/composer.json index 1e84a8b..57cd4c9 100644 --- a/composer.json +++ b/composer.json @@ -38,10 +38,10 @@ } }, "require-dev": { - "pestphp/pest": "^3.7", + "pestphp/pest": "^3.7|^4.0", "illuminate/auth": "^11.0|^12.0", "orchestra/testbench": "^9.9|^10.0", - "pestphp/pest-plugin-laravel": "^3.1", + "pestphp/pest-plugin-laravel": "^3.1|^4.0", "pestphp/pest-plugin-livewire": "^3.0|^4.0", "laravel/pint": "^1.21", "larastan/larastan": "^3.0", From 6b7c6a1f9a3ca38d8395ab2acc17380776805cd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Dalmolin?= Date: Fri, 23 Jan 2026 08:24:23 -0300 Subject: [PATCH 5/5] Fix import ordering in CommentionsServiceProvider --- src/CommentionsServiceProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CommentionsServiceProvider.php b/src/CommentionsServiceProvider.php index 604b0ea..1663849 100644 --- a/src/CommentionsServiceProvider.php +++ b/src/CommentionsServiceProvider.php @@ -2,12 +2,12 @@ namespace Kirschbaum\Commentions; +use Composer\InstalledVersions; use Filament\Support\Assets\Css; use Filament\Support\Assets\Js; use Filament\Support\Facades\FilamentAsset; use Illuminate\Support\Facades\Event; use Illuminate\Support\Facades\Gate; -use Composer\InstalledVersions; use Kirschbaum\Commentions\Comment as CommentModel; use Kirschbaum\Commentions\Events\UserWasMentionedEvent; use Kirschbaum\Commentions\Listeners\SendUserMentionedNotification;