From d90060509576a530fd33f07479750593208a89d5 Mon Sep 17 00:00:00 2001 From: Myra Oliveros Date: Wed, 22 Oct 2025 17:34:39 +0800 Subject: [PATCH 1/3] Add support for Laravel 12 --- composer.json | 11 +++++-- .../create_wallet_plus_tables.php.stub | 2 +- phpunit.xml.dist | 32 ++++++------------- src/WalletPlusServiceProvider.php | 4 +-- 4 files changed, 21 insertions(+), 28 deletions(-) diff --git a/composer.json b/composer.json index 7f6f964..115bff2 100644 --- a/composer.json +++ b/composer.json @@ -16,11 +16,16 @@ } ], "require": { - "php": "^7.3 || ^8.0" + "php": "^8.2", + "illuminate/support": "^12.0", + "illuminate/database": "^12.0", + "illuminate/contracts": "^12.0", + "nesbot/carbon": "^3.0" }, "require-dev": { - "symfony/var-dumper": "^4.3 || ^5.1 || ^6.0", - "phpunit/phpunit": "^8.2 || ^9.3" + "orchestra/testbench": "^10.0", + "phpunit/phpunit": "^11.0", + "symfony/var-dumper": "^7.0" }, "autoload": { "psr-4": { diff --git a/database/migrations/create_wallet_plus_tables.php.stub b/database/migrations/create_wallet_plus_tables.php.stub index 5f1337e..3f77abc 100644 --- a/database/migrations/create_wallet_plus_tables.php.stub +++ b/database/migrations/create_wallet_plus_tables.php.stub @@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -class CreateWalletPlusTables extends Migration +return new class extends Migration { /** * Run the migrations. diff --git a/phpunit.xml.dist b/phpunit.xml.dist index dc6a98a..9e84fc4 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,29 +1,17 @@ - + - + tests - - + + src/ - - - - - - - - - + + diff --git a/src/WalletPlusServiceProvider.php b/src/WalletPlusServiceProvider.php index 54db70b..aced97e 100644 --- a/src/WalletPlusServiceProvider.php +++ b/src/WalletPlusServiceProvider.php @@ -11,7 +11,7 @@ class WalletPlusServiceProvider extends ServiceProvider /** * Bootstrap the application services. */ - public function boot(Filesystem $filesystem) + public function boot(Filesystem $filesystem): void { $this->publishes([ __DIR__ . '/../database/migrations/create_wallet_plus_tables.php.stub' => @@ -22,7 +22,7 @@ public function boot(Filesystem $filesystem) /** * Register the application services. */ - public function register() + public function register(): void { // $this->mergeConfigFrom(__DIR__ . '/../config/config.php', 'wallet-plus'); } From 134c883675a1896ed4df20f249917ded3d7d6989 Mon Sep 17 00:00:00 2001 From: Myra Oliveros Date: Thu, 23 Oct 2025 09:46:06 +0800 Subject: [PATCH 2/3] Update workflow test --- .github/workflows/run-tests.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 1f0d9a4..f112d40 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -9,27 +9,27 @@ jobs: strategy: fail-fast: true matrix: - php: [7.4] - laravel: [6.*] + php: [8.2, 8.3, 8.4] + laravel: [12.*] dependency-version: [prefer-lowest, prefer-stable] include: - - laravel: 6.* - testbench: 4.* + - laravel: 12.* + testbench: 10.* name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} steps: - name: Checkout code - uses: actions/checkout@v1 + uses: actions/checkout@v4 - name: Cache dependencies - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ~/.composer/cache/files key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} - name: Setup PHP - uses: shivammathur/setup-php@v1 + uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} extension-csv: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick From cb2bbb89ea67db1c91d3094df1b16e16fc0889e8 Mon Sep 17 00:00:00 2001 From: Myra Oliveros Date: Thu, 23 Oct 2025 09:57:46 +0800 Subject: [PATCH 3/3] Fix syntax error in migration stub --- database/migrations/create_wallet_plus_tables.php.stub | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/migrations/create_wallet_plus_tables.php.stub b/database/migrations/create_wallet_plus_tables.php.stub index 3f77abc..dafc3b6 100644 --- a/database/migrations/create_wallet_plus_tables.php.stub +++ b/database/migrations/create_wallet_plus_tables.php.stub @@ -53,4 +53,4 @@ return new class extends Migration Schema::dropIfExists('wallets'); Schema::dropIfExists('wallet_ledgers'); } -} +};