From 796dbcd5e2657002a5789b776b072d272bb0f5a0 Mon Sep 17 00:00:00 2001 From: Oussama Sid Date: Fri, 19 Jun 2026 14:49:32 +0400 Subject: [PATCH 1/4] Add Laravel 11.x, 12.x, 13.x and PHP 8.3/8.4 support - orchestra/testbench: add ^9.0|^10.0|^11.0 for L11/L12/L13 - pestphp/pest: add ^2.0|^3.7 - pest-plugin-laravel: add ^2.0|^3.0 - nunomaduro/collision: add ^8.0 - nunomaduro/larastan: add ^3.0 - phpstan rules/phpunit: add ^2.0 - phpunit/phpunit: add ^11.0 - CI: expand matrix to L9-L13, PHP 8.1-8.4, carbon ">=3.8.4", actions/checkout v6 - CI: drop prefer-lowest, add --no-coverage - phpunit.xml.dist: remove deprecated PHPUnit 10+ attributes --- .github/workflows/run-tests.yml | 38 +++++++++++++++++++++++++++------ composer.json | 16 +++++++------- phpunit.xml.dist | 9 ++------ 3 files changed, 42 insertions(+), 21 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index e777376..889ff00 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -13,23 +13,46 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest, windows-latest] - php: [8.1, 8.2] - laravel: [9.*, 10.*] - stability: [prefer-lowest, prefer-stable] + php: [8.1, 8.2, 8.3, 8.4] + laravel: [9.*, 10.*, 11.*, 12.*, 13.*] + stability: [prefer-stable] include: - laravel: 9.* testbench: 7.* + carbon: ">=3.8.4" - laravel: 10.* testbench: 8.* + carbon: ">=3.8.4" + - laravel: 11.* + testbench: 9.* + carbon: ">=3.8.4" + - laravel: 12.* + testbench: 10.* + carbon: ">=3.8.4" + - laravel: 13.* + testbench: 11.* + carbon: ">=3.8.4" exclude: - laravel: 9.* php: 8.2 + - laravel: 9.* + php: 8.3 + - laravel: 9.* + php: 8.4 + - laravel: 11.* + php: 8.1 + - laravel: 12.* + php: 8.1 + - laravel: 13.* + php: 8.1 + - laravel: 13.* + php: 8.2 name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} steps: - name: Checkout code - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -45,8 +68,11 @@ jobs: - name: Install dependencies run: | - composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update + composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nesbot/carbon:${{ matrix.carbon }}" --no-interaction --no-update composer update --${{ matrix.stability }} --prefer-dist --no-interaction + - name: List Installed Dependencies + run: composer show -D + - name: Execute tests - run: vendor/bin/pest + run: vendor/bin/pest --ci --no-coverage diff --git a/composer.json b/composer.json index 2df4028..08704f1 100644 --- a/composer.json +++ b/composer.json @@ -22,15 +22,15 @@ }, "require-dev": { "laravel/pint": "^1.0", - "nunomaduro/collision": "^6.0|^7.0", - "nunomaduro/larastan": "^2.0.1", - "orchestra/testbench": "^7.0|^8.0", - "pestphp/pest": "^1.21", - "pestphp/pest-plugin-laravel": "^1.1", + "nunomaduro/collision": "^6.0|^7.0|^8.0", + "nunomaduro/larastan": "^2.0.1|^3.0", + "orchestra/testbench": "^7.0|^8.0|^9.0|^10.0|^11.0", + "pestphp/pest": "^1.21|^2.0|^3.7", + "pestphp/pest-plugin-laravel": "^1.1|^2.0|^3.0", "phpstan/extension-installer": "^1.1", - "phpstan/phpstan-deprecation-rules": "^1.0", - "phpstan/phpstan-phpunit": "^1.0", - "phpunit/phpunit": "^9.5|^10.0" + "phpstan/phpstan-deprecation-rules": "^1.0|^2.0", + "phpstan/phpstan-phpunit": "^1.0|^2.0", + "phpunit/phpunit": "^9.5|^10.0|^11.0" }, "autoload": { "psr-4": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 3e9b2cc..7d4b75f 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -3,20 +3,15 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" backupGlobals="false" - backupStaticAttributes="false" bootstrap="vendor/autoload.php" colors="true" - convertErrorsToExceptions="true" - convertNoticesToExceptions="true" - convertWarningsToExceptions="true" processIsolation="false" - stopOnFailure="false" executionOrder="random" failOnWarning="true" failOnRisky="true" failOnEmptyTestSuite="true" - beStrictAboutOutputDuringTests="true" - verbose="true" + cacheDirectory=".phpunit.cache" + backupStaticProperties="false" > From d0836ad6c0dc82ecb9f87f30d46d2780829fac98 Mon Sep 17 00:00:00 2001 From: ousid <21012933+ousid@users.noreply.github.com> Date: Fri, 19 Jun 2026 10:49:52 +0000 Subject: [PATCH 2/4] Fix styling --- config/laravel_ticket.php | 15 ++++++++++----- src/Concerns/HasTickets.php | 2 ++ src/Concerns/HasVisibility.php | 4 ++-- src/Concerns/InteractsWithTicketRelations.php | 5 +++-- tests/Database/Migrations/create_users_table.php | 2 +- 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/config/laravel_ticket.php b/config/laravel_ticket.php index bb1c898..642af7f 100644 --- a/config/laravel_ticket.php +++ b/config/laravel_ticket.php @@ -1,5 +1,10 @@ [ - 'ticket' => \Coderflex\LaravelTicket\Models\Ticket::class, - 'message' => \Coderflex\LaravelTicket\Models\Message::class, - 'category' => \Coderflex\LaravelTicket\Models\Category::class, - 'label' => \Coderflex\LaravelTicket\Models\Label::class, - ] + 'ticket' => Ticket::class, + 'message' => Message::class, + 'category' => Category::class, + 'label' => Label::class, + ], ]; diff --git a/src/Concerns/HasTickets.php b/src/Concerns/HasTickets.php index a4a61c1..d058e29 100644 --- a/src/Concerns/HasTickets.php +++ b/src/Concerns/HasTickets.php @@ -15,6 +15,7 @@ public function tickets(): HasMany 'laravel_ticket.models.ticket', parent::getTable() ); + return $this->hasMany($model, 'user_id'); } @@ -27,6 +28,7 @@ public function messages(): HasMany 'laravel_ticket.models.message', parent::getTable() ); + return $this->hasMany($model, 'user_id'); } } diff --git a/src/Concerns/HasVisibility.php b/src/Concerns/HasVisibility.php index 831b733..7697c74 100644 --- a/src/Concerns/HasVisibility.php +++ b/src/Concerns/HasVisibility.php @@ -10,7 +10,7 @@ trait HasVisibility /** * Determine whether if the model is visible * - * @return \Illuminate\Database\Eloquent\Builder + * @return Builder */ public function scopeVisible(Builder $builder) { @@ -20,7 +20,7 @@ public function scopeVisible(Builder $builder) /** * Determine whether if the model is hidden * - * @return \Illuminate\Database\Eloquent\Builder + * @return Builder */ public function scopeHidden(Builder $builder) { diff --git a/src/Concerns/InteractsWithTicketRelations.php b/src/Concerns/InteractsWithTicketRelations.php index be27289..2168a5b 100644 --- a/src/Concerns/InteractsWithTicketRelations.php +++ b/src/Concerns/InteractsWithTicketRelations.php @@ -3,6 +3,7 @@ namespace Coderflex\LaravelTicket\Concerns; use Illuminate\Database\Eloquent\Model; +use Illuminate\Support\Collection; trait InteractsWithTicketRelations { @@ -21,7 +22,7 @@ public function attachLabels($id, array $attributes = [], $touch = true) /** * Sync the intermediate tables with a list of IDs or collection of the ticket model.. * - * @param \Illuminate\Support\Collection|\Illuminate\Database\Eloquent\Model|array $ids + * @param Collection|Model|array $ids * @param bool $detaching * @return array */ @@ -45,7 +46,7 @@ public function attachCategories($id, array $attributes = [], $touch = true) /** * Sync the intermediate tables with a list of IDs or collection of the ticket model.. * - * @param \Illuminate\Support\Collection|\Illuminate\Database\Eloquent\Model|array $ids + * @param Collection|Model|array $ids * @param bool $detaching * @return array */ diff --git a/tests/Database/Migrations/create_users_table.php b/tests/Database/Migrations/create_users_table.php index 57f0097..d52f72d 100644 --- a/tests/Database/Migrations/create_users_table.php +++ b/tests/Database/Migrations/create_users_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class() extends Migration +return new class extends Migration { public function up() { From b560411fb6f54abd8325315988b6e56c04fb500a Mon Sep 17 00:00:00 2001 From: Oussama Sid Date: Fri, 19 Jun 2026 15:04:30 +0400 Subject: [PATCH 3/4] Fix L9 carbon constraint: use wildcard instead of >=3.8.4 Laravel 9 requires nesbot/carbon ^2.x; constraining to >=3.8.4 caused a dependency conflict. Use * for L9 which lets Composer resolve the correct Carbon 2.x version. --- .github/workflows/run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 889ff00..6862240 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -19,7 +19,7 @@ jobs: include: - laravel: 9.* testbench: 7.* - carbon: ">=3.8.4" + carbon: "*" - laravel: 10.* testbench: 8.* carbon: ">=3.8.4" From 0a6bac1d4a6cd039e3fe6df8e6ea7a273b68da01 Mon Sep 17 00:00:00 2001 From: Oussama Sid Date: Fri, 19 Jun 2026 15:19:43 +0400 Subject: [PATCH 4/4] Fix L10 carbon constraint and remove unneeded pest-plugin-laravel Laravel 10 uses Carbon 2.x, so the '*' wildcard avoids the Carbon 3 conflict. pest-plugin-laravel is redundant; Pest.php already applies uses(TestCase::class) from Orchestra Testbench. --- .github/workflows/run-tests.yml | 2 +- composer.json | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 6862240..8a322a9 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -22,7 +22,7 @@ jobs: carbon: "*" - laravel: 10.* testbench: 8.* - carbon: ">=3.8.4" + carbon: "*" - laravel: 11.* testbench: 9.* carbon: ">=3.8.4" diff --git a/composer.json b/composer.json index 08704f1..2ecd3f2 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,6 @@ "nunomaduro/larastan": "^2.0.1|^3.0", "orchestra/testbench": "^7.0|^8.0|^9.0|^10.0|^11.0", "pestphp/pest": "^1.21|^2.0|^3.7", - "pestphp/pest-plugin-laravel": "^1.1|^2.0|^3.0", "phpstan/extension-installer": "^1.1", "phpstan/phpstan-deprecation-rules": "^1.0|^2.0", "phpstan/phpstan-phpunit": "^1.0|^2.0",