Skip to content
Merged
Show file tree
Hide file tree
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
38 changes: 32 additions & 6 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: "*"
- laravel: 10.*
testbench: 8.*
carbon: "*"
- 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
Expand All @@ -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
15 changes: 7 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,14 @@
},
"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",
"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": {
Expand Down
15 changes: 10 additions & 5 deletions config/laravel_ticket.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<?php

use Coderflex\LaravelTicket\Models\Category;
use Coderflex\LaravelTicket\Models\Label;
use Coderflex\LaravelTicket\Models\Message;
use Coderflex\LaravelTicket\Models\Ticket;

return [
/*
|--------------------------------------------------------------------------
Expand Down Expand Up @@ -77,9 +82,9 @@
* 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,
]
'ticket' => Ticket::class,
'message' => Message::class,
'category' => Category::class,
'label' => Label::class,
],
];
9 changes: 2 additions & 7 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -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"
>
<testsuites>
<testsuite name="Coderflex Test Suite">
Expand Down
2 changes: 2 additions & 0 deletions src/Concerns/HasTickets.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public function tickets(): HasMany
'laravel_ticket.models.ticket',
parent::getTable()
);

return $this->hasMany($model, 'user_id');
}

Expand All @@ -27,6 +28,7 @@ public function messages(): HasMany
'laravel_ticket.models.message',
parent::getTable()
);

return $this->hasMany($model, 'user_id');
}
}
4 changes: 2 additions & 2 deletions src/Concerns/HasVisibility.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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)
{
Expand Down
5 changes: 3 additions & 2 deletions src/Concerns/InteractsWithTicketRelations.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Coderflex\LaravelTicket\Concerns;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Collection;

trait InteractsWithTicketRelations
{
Expand All @@ -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
*/
Expand All @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/Database/Migrations/create_users_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
Loading