Skip to content

Laravel 12.x Support. #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Mar 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ jobs:

- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v2.0.0
uses: dependabot/fetch-metadata@v2.3.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

2 changes: 1 addition & 1 deletion .github/workflows/fix-php-code-style-issues.yml
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ jobs:
ref: ${{ github.head_ref }}

- name: Fix PHP code style issues
uses: aglipanci/laravel-pint-action@2.3.1
uses: aglipanci/laravel-pint-action@2.5

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
14 changes: 7 additions & 7 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -19,20 +19,20 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest]
php: [8.1, 8.2]
laravel: [9.*, 10.*, 11.*]
php: [8.1, 8.2, 8.3]
laravel: [10.*, 11.*, 12.*]
stability: [prefer-lowest, prefer-stable]
include:
- laravel: 9.*
testbench: 7.*
- laravel: 10.*
testbench: 8.*
- laravel: 11.*
testbench: 9.*
- laravel: 12.*
testbench: 10.*
exclude:
- laravel: 9.*
php: 8.2
- larvel: 11.*
- laravel: 11.*
php: 8.1
- laravel: 12.*
php: 8.1

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
@@ -18,19 +18,19 @@
"require": {
"php": "^8.1",
"spatie/laravel-package-tools": "^1.13.0",
"illuminate/contracts": "^9.0|^10.0|^11.0"
"illuminate/contracts": "^9.0|^10.0|^11.0|^12.0"
},
"require-dev": {
"laravel/pint": "^1.0",
"nunomaduro/collision": "^6.0|^7.0|^8.0",
"nunomaduro/larastan": "^2.0.1",
"orchestra/testbench": "^7.0|^8.0|^9.0",
"pestphp/pest": "^1.21",
"pestphp/pest-plugin-laravel": "^1.1",
"nunomaduro/larastan": "^2.0.1|^3.0",
"orchestra/testbench": "^7.0|^8.0|^9.0|^10.0",
"phpunit/phpunit": "^9.5|^10.0|^11.0",
"pestphp/pest": "^1.21|^2.0|^3.7",
"pestphp/pest-plugin-arch": "^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|^11.0"
"phpstan/phpstan-deprecation-rules": "^1.0|^2.0",
"phpstan/phpstan-phpunit": "^1.0|^2.0"
},
"autoload": {
"psr-4": {
10 changes: 9 additions & 1 deletion config/laravel_ticket.php
Original file line number Diff line number Diff line change
@@ -73,5 +73,13 @@
],
],
],

/**
* Models for Eloquent relationships
*/
'models' => [
'ticket' => \Coderflex\LaravelTicket\Models\Ticket::class,
'message' => \Coderflex\LaravelTicket\Models\Message::class,
'category' => \Coderflex\LaravelTicket\Models\Category::class,
'label' => \Coderflex\LaravelTicket\Models\Label::class,
],
];
2 changes: 1 addition & 1 deletion src/Models/Category.php
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ class Category extends Model
*/
public function tickets(): BelongsToMany
{
return $this->belongsToMany(Ticket::class);
return $this->belongsToMany(config('laravel_ticket.models.ticket'));
}

/**
2 changes: 1 addition & 1 deletion src/Models/Label.php
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ class Label extends Model
*/
public function tickets(): BelongsToMany
{
return $this->belongsToMany(Ticket::class);
return $this->belongsToMany(config('laravel_ticket.models.ticket'));
}

/**
2 changes: 1 addition & 1 deletion src/Models/Message.php
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ public function ticket(): BelongsTo
$tableName = config('laravel_ticket.table_names.messages', 'messages');

return $this->belongsTo(
Ticket::class,
config('laravel_ticket.models.ticket'),
$tableName['columns']['ticket_foreign_id']
);
}
8 changes: 4 additions & 4 deletions src/Models/Ticket.php
Original file line number Diff line number Diff line change
@@ -61,7 +61,7 @@ public function messages(): HasMany
$tableName = config('laravel_ticket.table_names.messages', 'messages');

return $this->hasMany(
Message::class,
config('laravel_ticket.models.message'),
(string) $tableName['columns']['ticket_foreign_id'],
);
}
@@ -74,7 +74,7 @@ public function categories(): BelongsToMany
$table = config('laravel_ticket.table_names.category_ticket', 'category_ticket');

return $this->belongsToMany(
Category::class,
config('laravel_ticket.models.category'),
$table['table'],
$table['columns']['ticket_foreign_id'],
$table['columns']['category_foreign_id'],
@@ -89,7 +89,7 @@ public function labels(): BelongsToMany
$table = config('laravel_ticket.table_names.label_ticket', 'label_ticket');

return $this->belongsToMany(
Label::class,
config('laravel_ticket.models.label'),
$table['table'],
$table['columns']['ticket_foreign_id'],
$table['columns']['label_foreign_id'],
@@ -104,7 +104,7 @@ public function labels(): BelongsToMany
public function getTable()
{
return config(
'laravel_ticket.table_names.tickets',
'laravel_ticket.models.tickets',
parent::getTable()
);
}
2 changes: 1 addition & 1 deletion tests/Database/Migrations/create_users_table.php
Original file line number Diff line number Diff line change
@@ -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()
{