Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

Commit

Permalink
Merge pull request #42 from laravel-shift/l11-compatibility
Browse files Browse the repository at this point in the history
Laravel 11.x Compatibility
  • Loading branch information
mateusjunges committed Mar 12, 2024
2 parents 62dc500 + 49f909c commit e66a18f
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 133 deletions.
109 changes: 55 additions & 54 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,55 @@
name: Tests
on:
pull_request:
push:
branches: [main]
jobs:
test:
name: PHP ${{ matrix.php }}, Laravel ${{ matrix.laravel }}, ${{ matrix.dependencies }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['7.3', '7.4', '8.0', '8.1']
laravel: [6.*, 7.*, 8.*, 9.*, 10.*]
dependencies: [prefer-lowest, prefer-stable]
exclude:
- php: '7.3'
laravel: 10.*
- php: '7.4'
laravel: 10.*
- php: '8.0'
laravel: 10.*
- php: '7.3'
laravel: 9.*
- php: '7.4'
laravel: 9.*
- php: '8.1'
laravel: 6.*
- php: '8.1'
laravel: 7.*
- php: '8.1'
laravel: 8.*
dependencies: prefer-lowest
include:
- php: '8.1'
laravel: ^8.65
dependencies: prefer-lowest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: ~/.composer/cache/files
key: php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}
restore-keys: |
php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-composer-${{ matrix.dependencies }}-
php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-
php-${{ matrix.php }}-
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
- run: |
composer require laravel/framework:"${{ matrix.laravel }}" --no-update --no-interaction
composer update --${{ matrix.dependencies }} --prefer-dist --no-interaction
- run: vendor/bin/phpunit --testdox --colors=always
name: Tests

on:
pull_request:
push:
branches:
- main

jobs:
test:
name: PHP ${{ matrix.php }}, Laravel ${{ matrix.laravel }}, ${{ matrix.dependencies }}

runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php: ['8.1', '8.2', '8.3']
laravel: ['8.*', '9.*', '10.*', '11.*']
dependencies: [prefer-lowest, prefer-stable]
exclude:
- laravel: 11.*
php: '8.1'
- laravel: 8.*
php: '8.2'
- laravel: 9.*
php: '8.2'
- laravel: 8.*
php: '8.1'
- laravel: 9.*
php: '8.3'
- laravel: 8.*
php: '8.3'

steps:
- uses: actions/checkout@v2

- uses: actions/cache@v2
with:
path: ~/.composer/cache/files
key: php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}
restore-keys: |
php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-composer-${{ matrix.dependencies }}-
php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-
php-${{ matrix.php }}-
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}

- run: |
composer require laravel/framework:"${{ matrix.laravel }}" --no-update --no-interaction
composer update --${{ matrix.dependencies }} --prefer-dist --no-interaction
- run: vendor/bin/phpunit --testdox --colors=always
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@
}
],
"require": {
"php": "^7.1.3 || ~8.0",
"illuminate/config": "~5.6 || ~5.7 || ~5.8 || ^6.0 || ^7.0 || ^8.0 || ^9.0|^10.0",
"illuminate/console": "~5.6 || ~5.7 || ~5.8 || ^6.0 || ^7.0 || ^8.0 || ^9.0|^10.0",
"illuminate/log": "~5.6 || ~5.7 || ~5.8 || ^6.0 || ^7.0 || ^8.0 || ^9.0|^10.0",
"illuminate/support": "~5.6 || ~5.7 || ~5.8 || ^6.0 || ^7.0 || ^8.0 || ^9.0|^10.0"
"php": "^8.1",
"illuminate/config": "^8.0 || ^9.0 || ^10.0 || ^11.0",
"illuminate/console": "^8.0 || ^9.0 || ^10.0 || ^11.0",
"illuminate/log": "^8.0 || ^9.0 || ^10.0 || ^11.0",
"illuminate/support": "^8.0 || ^9.0 || ^10.0 || ^11.0"
},
"require-dev": {
"fakerphp/faker": "^1.9.1",
"laravel/legacy-factories": "^1.0.4",
"mockery/mockery": "^1.3.2",
"orchestra/testbench": "^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0|^8.0",
"phpunit/phpunit": "^8.5.21 || ^9.0"
"orchestra/testbench": "^6.0 || ^7.0 || ^8.0 || ^9.0",
"phpunit/phpunit": "^8.5 || ^9.0 || ^10.5"
},
"autoload": {
"psr-4": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateQuicksandCarTable extends Migration
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::connection('connection2')->create('cars', function (Blueprint $table) {
Expand All @@ -21,13 +16,8 @@ public function up()
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::connection('connection2')->dropIfExists('cars');
}
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateQuicksandGlobalScopedThingsTable extends Migration
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('global_scoped_things', function (Blueprint $table) {
Expand All @@ -21,13 +16,8 @@ public function up()
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('people');
}
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateQuicksandPeopleTable extends Migration
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('people', function (Blueprint $table) {
Expand All @@ -21,13 +16,8 @@ public function up()
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('people');
}
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateQuicksandPivotTable extends Migration
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('person_thing', function (Blueprint $table) {
Expand All @@ -26,13 +21,8 @@ public function up()
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('person_thing');
}
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateQuicksandPlacesTable extends Migration
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('places', function (Blueprint $table) {
Expand All @@ -19,13 +14,8 @@ public function up()
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('places');
}
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateQuicksandThingsTable extends Migration
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('things', function (Blueprint $table) {
Expand All @@ -21,13 +16,8 @@ public function up()
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('things');
}
}
};

0 comments on commit e66a18f

Please sign in to comment.