Skip to content

Commit

Permalink
Adds Laravel 11 support
Browse files Browse the repository at this point in the history
  • Loading branch information
nunomaduro committed Dec 6, 2023
1 parent 64715f9 commit 46dbe80
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 49 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@ jobs:
fail-fast: true
matrix:
php: ['8.0', 8.1, 8.2, 8.3]
laravel: [9, 10]
laravel: [9, 10, 11]
exclude:
- php: '8.0'
laravel: 10
- php: '8.0'
laravel: 11
- php: 8.1
laravel: 11
- php: 8.3
laravel: 9

Expand All @@ -45,6 +49,6 @@ jobs:
composer update --prefer-dist --no-interaction --no-progress
- name: Execute tests
run: vendor/bin/phpunit --verbose
run: vendor/bin/phpunit
env:
STRIPE_SECRET: ${{ secrets.STRIPE_SECRET }}
28 changes: 14 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,28 @@
"require": {
"php": "^8.0",
"ext-json": "*",
"illuminate/console": "^9.21|^10.0",
"illuminate/contracts": "^9.21|^10.0",
"illuminate/database": "^9.21|^10.0",
"illuminate/http": "^9.21|^10.0",
"illuminate/log": "^9.21|^10.0",
"illuminate/notifications": "^9.21|^10.0",
"illuminate/pagination": "^9.21|^10.0",
"illuminate/routing": "^9.21|^10.0",
"illuminate/support": "^9.21|^10.0",
"illuminate/view": "^9.21|^10.0",
"illuminate/console": "^9.21|^10.0|^11.0",
"illuminate/contracts": "^9.21|^10.0|^11.0",
"illuminate/database": "^9.21|^10.0|^11.0",
"illuminate/http": "^9.21|^10.0|^11.0",
"illuminate/log": "^9.21|^10.0|^11.0",
"illuminate/notifications": "^9.21|^10.0|^11.0",
"illuminate/pagination": "^9.21|^10.0|^11.0",
"illuminate/routing": "^9.21|^10.0|^11.0",
"illuminate/support": "^9.21|^10.0|^11.0",
"illuminate/view": "^9.21|^10.0|^11.0",
"moneyphp/money": "^4.0",
"nesbot/carbon": "^2.0",
"stripe/stripe-php": "^7.39|^8.0|^9.0|^10.0",
"symfony/http-kernel": "^6.0",
"stripe/stripe-php": "^7.39|^8.0|^9.0|^10.0|^11.0",
"symfony/http-kernel": "^6.0|^7.0",
"symfony/polyfill-intl-icu": "^1.22.1"
},
"require-dev": {
"dompdf/dompdf": "^2.0",
"mockery/mockery": "^1.0",
"orchestra/testbench": "^7.0|^8.0",
"orchestra/testbench": "^7.0|^8.0|^9.0",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^9.0"
"phpunit/phpunit": "^9.0|^10.4"
},
"suggest": {
"ext-intl": "Allows for more locales besides the default \"en\" when formatting money values.",
Expand Down
19 changes: 0 additions & 19 deletions src/Cashier.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,6 @@ class Cashier
*/
protected static $formatCurrencyUsing;

/**
* Indicates if Cashier migrations will be run.
*
* @var bool
*/
public static $runsMigrations = true;

/**
* Indicates if Cashier routes will be registered.
*
Expand Down Expand Up @@ -173,18 +166,6 @@ public static function formatAmount($amount, $currency = null, $locale = null, a
return $moneyFormatter->format($money);
}

/**
* Configure Cashier to not register its migrations.
*
* @return static
*/
public static function ignoreMigrations()
{
static::$runsMigrations = false;

return new static;
}

/**
* Configure Cashier to not register its routes.
*
Expand Down
17 changes: 3 additions & 14 deletions src/CashierServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public function boot()
$this->registerLogger();
$this->registerRoutes();
$this->registerResources();
$this->registerMigrations();
$this->registerPublishing();
$this->registerCommands();

Expand Down Expand Up @@ -123,18 +122,6 @@ protected function registerResources()
$this->loadViewsFrom(__DIR__.'/../resources/views', 'cashier');
}

/**
* Register the package migrations.
*
* @return void
*/
protected function registerMigrations()
{
if (Cashier::$runsMigrations && $this->app->runningInConsole()) {
$this->loadMigrationsFrom(__DIR__.'/../database/migrations');
}
}

/**
* Register the package's publishable resources.
*
Expand All @@ -147,7 +134,9 @@ protected function registerPublishing()
__DIR__.'/../config/cashier.php' => $this->app->configPath('cashier.php'),
], 'cashier-config');

$this->publishes([
$method = method_exists($this, 'publishesMigrations') ? 'publishesMigrations' : 'publishes';

$this->{$method}([
__DIR__.'/../database/migrations' => $this->app->databasePath('migrations'),
], 'cashier-migrations');

Expand Down

0 comments on commit 46dbe80

Please sign in to comment.