From f05a19069ca892770218bde2a5e239362c969751 Mon Sep 17 00:00:00 2001 From: John F <15612814+usernotnull@users.noreply.github.com> Date: Wed, 9 Feb 2022 12:58:52 +0200 Subject: [PATCH] Support Laravel 9.x --- .github/workflows/checks.yml | 7 +++++-- README.md | 17 +++++++++-------- bootstrap/app.php | 1 + composer.json | 17 ++++++++++------- phpstan.neon.dist | 14 +++----------- 5 files changed, 28 insertions(+), 28 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index f1a27e1..fbe7580 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -16,10 +16,13 @@ jobs: matrix: os: [ ubuntu-latest ] #, windows-latest php: [ 8.0 ] - laravel: [ 8.* ] + laravel: [ 8.*, 9.* ] stability: [ prefer-lowest ] #, prefer-stable include: - laravel: 8.* + testbench: 6.* + - laravel: 9.* + testbench: 7.* steps: - name: Checkout Code uses: actions/checkout@v2 @@ -45,7 +48,7 @@ jobs: - name: Install Composer dependencies run: | - composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update --dev + composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update --dev composer update --${{ matrix.stability }} --prefer-dist --no-interaction - name: Psalm diff --git a/README.md b/README.md index b76296e..c0fe9a4 100644 --- a/README.md +++ b/README.md @@ -143,13 +143,13 @@ To stay updated, [follow me on Twitter](https://twitter.com/usernotnull). ## Requirements -Dependency | Version | Comment -----|----|---- -PHP | ^8.0 | Make the switch, you won't regret it :) -Laravel | ^8.0 | [Official Installation Docs](https://laravel.com/docs/8.x/installation) -TailwindCSS | ^2.0 |[Official Installation Docs](https://tailwindcss.com/docs/guides/laravel) -Livewire | ^2.0 | [Official Installation Docs](https://laravel-livewire.com/docs/2.x/installation) -AlpineJS | ^3.0 | [Official Installation Docs](https://alpinejs.dev/essentials/installation) +Dependency | Version +----|---- +PHP | ^8.0 +Laravel | ^8.0 \| ^9.0 +TailwindCSS | ^2.0 \| ^3.0 +Livewire | ^2.0 +AlpineJS | ^3.0 ## Installation @@ -175,7 +175,8 @@ If you are using [Just-in-Time Mode](https://tailwindcss.com/docs/just-in-time-m your `tailwind.config.js` file: ```js -purge: [ +// use `purge` instead of `content` if using TailwindCSS v2.x +content: [ './vendor/usernotnull/tall-toasts/config/**/*.php', './vendor/usernotnull/tall-toasts/resources/views/**/*.blade.php', // etc... diff --git a/bootstrap/app.php b/bootstrap/app.php index be109ab..62be2fb 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -3,3 +3,4 @@ declare(strict_types=1); /* This file is required for phpstan */ +return include getcwd()."/vendor/orchestra/testbench-core/laravel/bootstrap/app.php"; diff --git a/composer.json b/composer.json index d21ba29..cc67a17 100644 --- a/composer.json +++ b/composer.json @@ -26,20 +26,19 @@ ], "require": { "php": "^8.0", - "illuminate/contracts": "^v8.61", + "illuminate/contracts": "^v8.61|^9.0", "livewire/livewire": "^v2.10", "spatie/laravel-package-tools": "^1.11" }, "require-dev": { "friendsofphp/php-cs-fixer": "^v3.4", - "nunomaduro/collision": "^5.11", - "nunomaduro/larastan": "^0.7.15", - "orchestra/testbench": "^v6.24", + "nunomaduro/collision": "^5.11|^6.0", + "nunomaduro/larastan": "^2.0", + "orchestra/testbench": "^v6.24|^7.0", "pestphp/pest": "^v1.21", "pestphp/pest-plugin-laravel": "^v1.2", "phpmd/phpmd": "^2.11", - "pestphp/pest-plugin-parallel": "^1.0.0", - "phpstan/phpstan": "^0.12", + "pestphp/pest-plugin-parallel": "^1.0", "squizlabs/php_codesniffer": "^3.6", "vimeo/psalm": "^4.20" }, @@ -62,7 +61,11 @@ "test-coverage": "XDEBUG_MODE=coverage ./vendor/bin/pest --parallel --coverage --min=100" }, "config": { - "sort-packages": true + "sort-packages": true, + "allow-plugins": { + "pestphp/pest-plugin": true, + "composer/package-versions-deprecated": true + } }, "extra": { "laravel": { diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 3bb637f..545a0d5 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -2,15 +2,14 @@ includes: - ./vendor/nunomaduro/larastan/extension.neon parameters: - paths: - src - # The level 8 is the highest level + # The level 9 is the highest level level: 5 excludePaths: -# - ./src/ToastServiceProvider.php + - ./src/ToastServiceProvider.php ignoreErrors: - '#Unsafe usage of new static#' @@ -18,13 +17,6 @@ parameters: - '#Call to an undefined static method#' - '#Parameter (\#)(\d) \$callback of method Illuminate\\Container\\Container::call\(\) expects \(callable\(\): (.*)#' - '#Parameter (\#)(\d) \$callback of function view expects view-string|null, string given#' - - path: database/factories/* - message: '#Undefined variable: \$factory#' - - checkMissingIterableValueType: false reportUnmatchedIgnoredErrors: false - -# noUnnecessaryCollectionCall: false - -# checkOctaneCompatibility: true + checkOctaneCompatibility: true