Skip to content

Commit c88257d

Browse files
authored
Add Laravel 11.x, 12.x, 13.x and PHP 8.3/8.4 support
Add Laravel 11.x, 12.x, 13.x and PHP 8.3/8.4 support
2 parents d43ffaa + 0a6bac1 commit c88257d

8 files changed

Lines changed: 59 additions & 31 deletions

File tree

.github/workflows/run-tests.yml

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,46 @@ jobs:
1313
fail-fast: true
1414
matrix:
1515
os: [ubuntu-latest, windows-latest]
16-
php: [8.1, 8.2]
17-
laravel: [9.*, 10.*]
18-
stability: [prefer-lowest, prefer-stable]
16+
php: [8.1, 8.2, 8.3, 8.4]
17+
laravel: [9.*, 10.*, 11.*, 12.*, 13.*]
18+
stability: [prefer-stable]
1919
include:
2020
- laravel: 9.*
2121
testbench: 7.*
22+
carbon: "*"
2223
- laravel: 10.*
2324
testbench: 8.*
25+
carbon: "*"
26+
- laravel: 11.*
27+
testbench: 9.*
28+
carbon: ">=3.8.4"
29+
- laravel: 12.*
30+
testbench: 10.*
31+
carbon: ">=3.8.4"
32+
- laravel: 13.*
33+
testbench: 11.*
34+
carbon: ">=3.8.4"
2435
exclude:
2536
- laravel: 9.*
2637
php: 8.2
38+
- laravel: 9.*
39+
php: 8.3
40+
- laravel: 9.*
41+
php: 8.4
42+
- laravel: 11.*
43+
php: 8.1
44+
- laravel: 12.*
45+
php: 8.1
46+
- laravel: 13.*
47+
php: 8.1
48+
- laravel: 13.*
49+
php: 8.2
2750

2851
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
2952

3053
steps:
3154
- name: Checkout code
32-
uses: actions/checkout@v5
55+
uses: actions/checkout@v6
3356

3457
- name: Setup PHP
3558
uses: shivammathur/setup-php@v2
@@ -45,8 +68,11 @@ jobs:
4568
4669
- name: Install dependencies
4770
run: |
48-
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
71+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nesbot/carbon:${{ matrix.carbon }}" --no-interaction --no-update
4972
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
5073
74+
- name: List Installed Dependencies
75+
run: composer show -D
76+
5177
- name: Execute tests
52-
run: vendor/bin/pest
78+
run: vendor/bin/pest --ci --no-coverage

composer.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,14 @@
2222
},
2323
"require-dev": {
2424
"laravel/pint": "^1.0",
25-
"nunomaduro/collision": "^6.0|^7.0",
26-
"nunomaduro/larastan": "^2.0.1",
27-
"orchestra/testbench": "^7.0|^8.0",
28-
"pestphp/pest": "^1.21",
29-
"pestphp/pest-plugin-laravel": "^1.1",
25+
"nunomaduro/collision": "^6.0|^7.0|^8.0",
26+
"nunomaduro/larastan": "^2.0.1|^3.0",
27+
"orchestra/testbench": "^7.0|^8.0|^9.0|^10.0|^11.0",
28+
"pestphp/pest": "^1.21|^2.0|^3.7",
3029
"phpstan/extension-installer": "^1.1",
31-
"phpstan/phpstan-deprecation-rules": "^1.0",
32-
"phpstan/phpstan-phpunit": "^1.0",
33-
"phpunit/phpunit": "^9.5|^10.0"
30+
"phpstan/phpstan-deprecation-rules": "^1.0|^2.0",
31+
"phpstan/phpstan-phpunit": "^1.0|^2.0",
32+
"phpunit/phpunit": "^9.5|^10.0|^11.0"
3433
},
3534
"autoload": {
3635
"psr-4": {

config/laravel_ticket.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<?php
22

3+
use Coderflex\LaravelTicket\Models\Category;
4+
use Coderflex\LaravelTicket\Models\Label;
5+
use Coderflex\LaravelTicket\Models\Message;
6+
use Coderflex\LaravelTicket\Models\Ticket;
7+
38
return [
49
/*
510
|--------------------------------------------------------------------------
@@ -77,9 +82,9 @@
7782
* Models for Eloquent relationships
7883
*/
7984
'models' => [
80-
'ticket' => \Coderflex\LaravelTicket\Models\Ticket::class,
81-
'message' => \Coderflex\LaravelTicket\Models\Message::class,
82-
'category' => \Coderflex\LaravelTicket\Models\Category::class,
83-
'label' => \Coderflex\LaravelTicket\Models\Label::class,
84-
]
85+
'ticket' => Ticket::class,
86+
'message' => Message::class,
87+
'category' => Category::class,
88+
'label' => Label::class,
89+
],
8590
];

phpunit.xml.dist

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,15 @@
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
55
backupGlobals="false"
6-
backupStaticAttributes="false"
76
bootstrap="vendor/autoload.php"
87
colors="true"
9-
convertErrorsToExceptions="true"
10-
convertNoticesToExceptions="true"
11-
convertWarningsToExceptions="true"
128
processIsolation="false"
13-
stopOnFailure="false"
149
executionOrder="random"
1510
failOnWarning="true"
1611
failOnRisky="true"
1712
failOnEmptyTestSuite="true"
18-
beStrictAboutOutputDuringTests="true"
19-
verbose="true"
13+
cacheDirectory=".phpunit.cache"
14+
backupStaticProperties="false"
2015
>
2116
<testsuites>
2217
<testsuite name="Coderflex Test Suite">

src/Concerns/HasTickets.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public function tickets(): HasMany
1515
'laravel_ticket.models.ticket',
1616
parent::getTable()
1717
);
18+
1819
return $this->hasMany($model, 'user_id');
1920
}
2021

@@ -27,6 +28,7 @@ public function messages(): HasMany
2728
'laravel_ticket.models.message',
2829
parent::getTable()
2930
);
31+
3032
return $this->hasMany($model, 'user_id');
3133
}
3234
}

src/Concerns/HasVisibility.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ trait HasVisibility
1010
/**
1111
* Determine whether if the model is visible
1212
*
13-
* @return \Illuminate\Database\Eloquent\Builder
13+
* @return Builder
1414
*/
1515
public function scopeVisible(Builder $builder)
1616
{
@@ -20,7 +20,7 @@ public function scopeVisible(Builder $builder)
2020
/**
2121
* Determine whether if the model is hidden
2222
*
23-
* @return \Illuminate\Database\Eloquent\Builder
23+
* @return Builder
2424
*/
2525
public function scopeHidden(Builder $builder)
2626
{

src/Concerns/InteractsWithTicketRelations.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Coderflex\LaravelTicket\Concerns;
44

55
use Illuminate\Database\Eloquent\Model;
6+
use Illuminate\Support\Collection;
67

78
trait InteractsWithTicketRelations
89
{
@@ -21,7 +22,7 @@ public function attachLabels($id, array $attributes = [], $touch = true)
2122
/**
2223
* Sync the intermediate tables with a list of IDs or collection of the ticket model..
2324
*
24-
* @param \Illuminate\Support\Collection|\Illuminate\Database\Eloquent\Model|array $ids
25+
* @param Collection|Model|array $ids
2526
* @param bool $detaching
2627
* @return array
2728
*/
@@ -45,7 +46,7 @@ public function attachCategories($id, array $attributes = [], $touch = true)
4546
/**
4647
* Sync the intermediate tables with a list of IDs or collection of the ticket model..
4748
*
48-
* @param \Illuminate\Support\Collection|\Illuminate\Database\Eloquent\Model|array $ids
49+
* @param Collection|Model|array $ids
4950
* @param bool $detaching
5051
* @return array
5152
*/

tests/Database/Migrations/create_users_table.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use Illuminate\Database\Schema\Blueprint;
55
use Illuminate\Support\Facades\Schema;
66

7-
return new class() extends Migration
7+
return new class extends Migration
88
{
99
public function up()
1010
{

0 commit comments

Comments
 (0)