Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support laravel 11 #229

Merged
merged 18 commits into from
Mar 27, 2024
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
12 changes: 2 additions & 10 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,9 @@ jobs:
fail-fast: true
matrix:
os: [ ubuntu-latest ]
php: [ 8.2, 8.1, 8.0]
laravel: [ 10.*, 9.* ]
php: [8.3, 8.2, 8.1]
laravel: [ 11.*, 10.* ]
dependency-version: [ prefer-stable ]
include:
- laravel: 9.*
testbench: 7.*
- laravel: 10.*
testbench: 8.*
exclude:
- laravel: 10.*
php: 8.0

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}

Expand Down
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,22 @@
}
],
"require": {
"php": "^8.0",
"php": "^8.1",
"ext-json": "*",
"ext-intl": "*",
"dompdf/dompdf": "^2.0",
"illuminate/database": "^9.0|^10",
"illuminate/support": "^9.0|^10",
"mollie/laravel-mollie": "^2.22",
"mollie/mollie-api-php": "^2.27",
"illuminate/database": "^10|^11",
"illuminate/support": "^10|^11",
"mollie/laravel-mollie": "^3.0",
"mollie/mollie-api-php": "^2.65",
"moneyphp/money": "^4.1",
"nesbot/carbon": "^2.31"
"nesbot/carbon": "^2.72|^3.0"
},
"require-dev": {
"guzzlehttp/guzzle": "^7.0",
"mockery/mockery": "^1.4",
"orchestra/testbench": "^7.0|^8.0",
"phpunit/phpunit": "^9.5"
"orchestra/testbench": "^8.0|^9.0",
"phpunit/phpunit": "^10.0"
},
"autoload": {
"files": [
Expand Down
4 changes: 2 additions & 2 deletions database/migrations/create_applied_coupons_table.php.stub
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class CreateAppliedCouponsTable extends Migration
*
* @return void
*/
public function up()
public function up(): void
{
Schema::create('applied_coupons', function (Blueprint $table) {
$table->bigIncrements('id');
Expand All @@ -26,7 +26,7 @@ class CreateAppliedCouponsTable extends Migration
*
* @return void
*/
public function down()
public function down(): void
{
Schema::dropIfExists('applied_coupons');
}
Expand Down
4 changes: 2 additions & 2 deletions database/migrations/create_credits_table.php.stub
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class CreateCreditsTable extends Migration
*
* @return void
*/
public function up()
public function up(): void
{
Schema::create('credits', function (Blueprint $table) {
$table->bigIncrements('id');
Expand All @@ -28,7 +28,7 @@ class CreateCreditsTable extends Migration
*
* @return void
*/
public function down()
public function down(): void
{
Schema::dropIfExists('credits');
}
Expand Down
4 changes: 2 additions & 2 deletions database/migrations/create_order_items_table.php.stub
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class CreateOrderItemsTable extends Migration
*
* @return void
*/
public function up()
public function up(): void
{
Schema::create('order_items', function (Blueprint $table) {
$table->bigIncrements('id');
Expand All @@ -36,7 +36,7 @@ class CreateOrderItemsTable extends Migration
*
* @return void
*/
public function down()
public function down(): void
{
Schema::dropIfExists('order_items');
}
Expand Down
4 changes: 2 additions & 2 deletions database/migrations/create_orders_table.php.stub
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class CreateOrdersTable extends Migration
*
* @return void
*/
public function up()
public function up(): void
{
Schema::create('orders', function (Blueprint $table) {
$table->bigIncrements('id');
Expand Down Expand Up @@ -39,7 +39,7 @@ class CreateOrdersTable extends Migration
*
* @return void
*/
public function down()
public function down(): void
{
Schema::dropIfExists('orders');
}
Expand Down
4 changes: 2 additions & 2 deletions database/migrations/create_payments_table.php.stub
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class CreatePaymentsTable extends Migration
*
* @return void
*/
public function up()
public function up(): void
{
Schema::create('payments', function (Blueprint $table) {
$table->bigIncrements('id');
Expand All @@ -35,7 +35,7 @@ class CreatePaymentsTable extends Migration
*
* @return void
*/
public function down()
public function down(): void
{
Schema::dropIfExists('payments');
}
Expand Down
4 changes: 2 additions & 2 deletions database/migrations/create_redeemed_coupons_table.php.stub
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class CreateRedeemedCouponsTable extends Migration
*
* @return void
*/
public function up()
public function up(): void
{
Schema::create('redeemed_coupons', function (Blueprint $table) {
$table->bigIncrements('id');
Expand All @@ -30,7 +30,7 @@ class CreateRedeemedCouponsTable extends Migration
*
* @return void
*/
public function down()
public function down(): void
{
Schema::dropIfExists('redeemed_coupons');
}
Expand Down
4 changes: 2 additions & 2 deletions database/migrations/create_refund_items_table.php.stub
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class CreateRefundItemsTable extends Migration
*
* @return void
*/
public function up()
public function up(): void
{
Schema::create('refund_items', function (Blueprint $table) {
$table->bigIncrements('id');
Expand All @@ -34,7 +34,7 @@ class CreateRefundItemsTable extends Migration
*
* @return void
*/
public function down()
public function down(): void
{
Schema::dropIfExists('refund_items');
}
Expand Down
4 changes: 2 additions & 2 deletions database/migrations/create_refunds_table.php.stub
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class CreateRefundsTable extends Migration
*
* @return void
*/
public function up()
public function up(): void
{
Schema::create('refunds', function (Blueprint $table) {
$table->bigIncrements('id');
Expand All @@ -32,7 +32,7 @@ class CreateRefundsTable extends Migration
*
* @return void
*/
public function down()
public function down(): void
{
Schema::dropIfExists('refunds');
}
Expand Down
4 changes: 2 additions & 2 deletions database/migrations/create_subscriptions_table.php.stub
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class CreateSubscriptionsTable extends Migration
*
* @return void
*/
public function up()
public function up(): void
{
Schema::create('subscriptions', function (Blueprint $table) {
$table->bigIncrements('id');
Expand All @@ -36,7 +36,7 @@ class CreateSubscriptionsTable extends Migration
*
* @return void
*/
public function down()
public function down(): void
{
Schema::dropIfExists('subscriptions');
}
Expand Down
5 changes: 2 additions & 3 deletions database/migrations/upgrade_to_cashier_v2.php.stub
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class UpgradeToCashierV2 extends Migration
*
* @return void
*/
public function up()
public function up(): void
{
Schema::table('orders', function (Blueprint $table) {
$table->unsignedInteger('amount_refunded')->after('total_due')->default(0);
Expand Down Expand Up @@ -67,9 +67,8 @@ class UpgradeToCashierV2 extends Migration
*
* @return void
*/
public function down()
public function down(): void
{
// Requires "doctrine/dbal" in composer.json
// Schema::table('orders', function (Blueprint $table) {
// $table->dropColumn(['amount_refunded', 'amount_charged_back']);
// });
Expand Down
9 changes: 6 additions & 3 deletions docs/01-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Once you have pulled in the package:
{
return [$this->name, $this->email];
}

/**
* Get additional information to be displayed on the invoice. Typically a note provided by the customer.
*
Expand All @@ -82,10 +82,13 @@ Once you have pulled in the package:
}
```

6. Schedule a periodic job to execute the `cashier:run` command. When processing lots of orders, consider increasing the job frequency to prevent hitting Mollie's rate limiter.
6. Schedule a periodic command to execute the `CashierRun` command. When processing lots of orders, consider increasing the job frequency to prevent hitting Mollie's rate limiter.

```php
$schedule->command('cashier:run')
use Illuminate\Support\Facades\Schedule;
use Laravel\Cashier\Console\Commands\CashierRun;

Schedule::command(CashierRun::class)
->hourly() // run as often as you like (daily, monthly, every minute, ...)
->withoutOverlapping(); // make sure to include this
```
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" backupStaticAttributes="false" colors="true" verbose="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory suffix=".php">src/</directory>
</include>
</coverage>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<testsuites>
<testsuite name="Test Suite">
<directory>tests</directory>
Expand Down Expand Up @@ -34,4 +29,9 @@
<!-- <env name="PAYMENT_PAID_ID" value=""/>-->
<!-- <env name="PAYMENT_FAILED_ID" value=""/>-->
</php>
<source>
<include>
<directory suffix=".php">src/</directory>
</include>
</source>
</phpunit>
Loading
Loading