diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml
index 628cd13..bf3e1ff 100644
--- a/.github/workflows/unittest.yml
+++ b/.github/workflows/unittest.yml
@@ -3,7 +3,7 @@ name: Testing Laravel with MySQL
on: [pull_request]
jobs:
laravel:
- name: Laravel (PHP ${{ matrix.php-versions }})
+ name: Laravel ${{ matrix.laravel }} (PHP ${{ matrix.php }})
runs-on: ubuntu-latest
env:
DB_DATABASE: logtodb
@@ -29,10 +29,16 @@ jobs:
strategy:
fail-fast: false
matrix:
- php-versions: ['8.2']
+ laravel: [ ^10.0, ^11.0 ]
+ php: ['8.2', '8.3']
+ include:
+ - laravel: ^10.0
+ testbench: ^8.0
+ - laravel: ^11.0
+ testbench: ^9.0
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.10.0
@@ -43,7 +49,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
- php-version: ${{ matrix.php-versions }}
+ php-version: ${{ matrix.php }}
extensions: mbstring, dom, fileinfo, mysql, mongodb
coverage: xdebug
@@ -53,7 +59,9 @@ jobs:
# run: sudo systemctl start mysql.service
- name: Install Composer dependencies
- run: composer install --no-progress
+ run: |
+ composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
+ composer update --prefer-dist --no-interaction --no-progress
- name: Test with phpunit
run: vendor/bin/phpunit --coverage-clover ./coverage.xml
diff --git a/composer.json b/composer.json
index fbb80b5..2cc3d5f 100644
--- a/composer.json
+++ b/composer.json
@@ -1,7 +1,16 @@
{
"name": "danielme85/laravel-log-to-db",
"description": "Custom Laravel Log channel handler that can store log events to SQL or MongoDB databases. Uses Laravel native logging functionality.",
- "keywords": ["laravel", "logging", "log", "database", "db", "mysql", "sql", "mongodb"],
+ "keywords": [
+ "laravel",
+ "logging",
+ "log",
+ "database",
+ "db",
+ "mysql",
+ "sql",
+ "mongodb"
+ ],
"type": "library",
"license": "MIT",
"authors": [
@@ -12,14 +21,14 @@
],
"require": {
"php": "^8.1",
- "illuminate/support": "^10.0"
+ "illuminate/support": "^10.0|^11.0"
},
"require-dev": {
"ext-mongodb": "*",
- "phpunit/phpunit": "9.*",
- "orchestra/testbench": "^8.0",
+ "phpunit/phpunit": "^10.0",
+ "orchestra/testbench": "^8.0|^9.0",
"mockery/mockery": "^1.5",
- "nunomaduro/collision": "^7.0",
+ "nunomaduro/collision": "^7.0|^8.0",
"mongodb/laravel-mongodb": "^4"
},
"suggest": {
@@ -30,6 +39,11 @@
"danielme85\\LaravelLogToDB\\": "src"
}
},
+ "autoload-dev": {
+ "psr-4": {
+ "TestModels\\": "tests/TestModels"
+ }
+ },
"extra": {
"laravel": {
"providers": [
@@ -41,4 +55,4 @@
}
},
"minimum-stability": "dev"
-}
+}
\ No newline at end of file
diff --git a/phpunit.xml b/phpunit.xml
index 86ac476..28d70d6 100644
--- a/phpunit.xml
+++ b/phpunit.xml
@@ -8,6 +8,7 @@
./tests/
+ ./tests/TestModels