From 6237c130ace0777cf070b9993c6eb0f14d0dd446 Mon Sep 17 00:00:00 2001 From: jim Date: Wed, 22 Feb 2023 06:54:57 +0000 Subject: [PATCH] Add support for larvel 10 --- .github/workflows/run-tests.yml | 9 +++++++-- composer.json | 10 +++++----- src/LaravelDraftsServiceProvider.php | 3 +++ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 9c9e5ba..8aa31f0 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -13,12 +13,17 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest, windows-latest] - php: [8.0,8.1] - laravel: [9.*] + php: [8.0,8.1,8.2] + laravel: [9.*,10.*] stability: [prefer-lowest, prefer-stable] include: - laravel: 9.* testbench: 7.* + - laravel: 10.* + testbench: 8.* + exclude: + - php: 8.0 + laravel: 10.* name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} diff --git a/composer.json b/composer.json index 2a29119..6adb8a4 100644 --- a/composer.json +++ b/composer.json @@ -19,22 +19,22 @@ "require": { "php": "^8.0", "doctrine/dbal": "^3.3", - "illuminate/contracts": "^9.0", + "illuminate/contracts": "^9.0|^10.0", "spatie/laravel-package-tools": "^1.9.2" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.8", "nunomaduro/collision": "^6.0", "nunomaduro/larastan": "^2.0.1", - "orchestra/testbench": "^7.0", + "orchestra/testbench": "^7.0|^8.0", "pestphp/pest": "^1.21", - "pestphp/pest-plugin-laravel": "^1.1", + "pestphp/pest-plugin-laravel": "^1.1|^2.0", "phpstan/extension-installer": "^1.1", "phpstan/phpstan-deprecation-rules": "^1.0", "phpstan/phpstan-phpunit": "^1.0", "phpunit/phpunit": "^9.5", - "spatie/laravel-ray": "^1.26", - "spatie/pest-plugin-test-time": "^1.1" + "spatie/pest-plugin-test-time": "^1.1", + "roave/security-advisories": "dev-latest" }, "autoload": { "psr-4": { diff --git a/src/LaravelDraftsServiceProvider.php b/src/LaravelDraftsServiceProvider.php index 632ef46..7902dc3 100644 --- a/src/LaravelDraftsServiceProvider.php +++ b/src/LaravelDraftsServiceProvider.php @@ -3,6 +3,7 @@ namespace Oddvalue\LaravelDrafts; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; use Spatie\LaravelPackageTools\Package; use Spatie\LaravelPackageTools\PackageServiceProvider; @@ -23,6 +24,8 @@ public function configurePackage(Package $package): void public function packageRegistered() { + Schema::useNativeSchemaOperationsIfPossible(); + Blueprint::macro('drafts', function ( string $uuid = null, string $publishedAt = null,