Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Commit

Permalink
Adding support for Laravel 9 (#1100)
Browse files Browse the repository at this point in the history
* Adding support for Laravel 9

* Update tests for laravel 9.

* Ignore some strategy

* update orchestra version dependencies

* Fix tests

Co-authored-by: Lucas Michot <lucas@semalead.com>
  • Loading branch information
steveperrycreative and lucasmichot authored Aug 26, 2022
1 parent 9cdd1b2 commit 7beefe7
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 10 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,23 @@ jobs:
laravel:
- '7.0'
- '8.22'
- '9.0'
exclude:
- php: '7.2'
laravel: '8.22'
- php: '7.2'
laravel: '9.0'
- php: '7.3'
laravel: '9.0'
- php: '7.4'
laravel: '9.0'
- php: '8.0'
laravel: '7.0'
- php: '8.0'
laravel: '8.22'
laravel: '9.0'
include:
- php: '8.0'
laravel: '8.22'
laravel: '9.0'
analysis: true
coverage: 'xdebug'
normalize: true
Expand All @@ -54,7 +61,7 @@ jobs:
run: composer validate --strict

- name: Install Laravel legacy factories support
if: matrix.laravel == '8.22'
if: matrix.laravel != '7.0'
run: composer require "laravel/legacy-factories:^1.1" --dev --no-interaction --no-update

- name: Install Laravel and Orchestra Testbench
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
"ext-json": "*",
"funeralzone/valueobjects": "^0.5",
"jenssegers/agent": "^2.6",
"laravel/framework": "^7.0 || ^8.0",
"laravel/framework": "^7.0 || ^8.0 || ^9.0",
"osiset/basic-shopify-api": "^9.0 || ^10.0"
},
"require-dev": {
"ergebnis/composer-normalize": "^2.8",
"friendsofphp/php-cs-fixer": "^3.0",
"mockery/mockery": "^1.0",
"orchestra/database": "~3.8 || ~4.0 || ~5.0 || ~6.0",
"orchestra/testbench": "~3.8 || ~4.0 || ~5.0 || ~6.0",
"orchestra/database": "~3.8 || ~4.0 || ~5.0 || ~6.0 || ~7.0",
"orchestra/testbench": "~3.8 || ~4.0 || ~5.0 || ~6.0 || ~7.0",
"phpstan/phpstan": "^0.12",
"phpunit/phpunit": "~8.0 || ^9.0"
},
Expand Down
6 changes: 3 additions & 3 deletions src/Traits/BillingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ trait BillingController
/**
* Redirects to billing screen for Shopify.
*
* @param int|null $plan The plan's ID, if provided in route.
* @param Request $request The request object.
* @param ShopQuery $shopQuery The shop querier.
* @param GetPlanUrl $getPlanUrl The action for getting the plan URL.
* @param int|null $plan The plan's ID, if provided in route.
*
* @return ViewView
*/
public function index(
?int $plan = null,
Request $request,
ShopQuery $shopQuery,
GetPlanUrl $getPlanUrl
GetPlanUrl $getPlanUrl,
?int $plan = null
): ViewView {
// Get the shop
$shop = $shopQuery->getByDomain(ShopDomain::fromNative($request->get('shop')));
Expand Down
24 changes: 23 additions & 1 deletion tests/Stubs/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use Osiset\ShopifyApp\Http\Middleware\Billable;
use Osiset\ShopifyApp\Http\Middleware\VerifyShopify;

class Kernel extends \Orchestra\Testbench\Http\Kernel
class Kernel extends \Orchestra\Testbench\Foundation\Http\Kernel
{
/**
* The application's route middleware.
Expand All @@ -36,4 +36,26 @@ class Kernel extends \Orchestra\Testbench\Http\Kernel
'auth.proxy' => AuthProxy::class,
'billable' => Billable::class,
];

/**
* The application's route middleware groups.
*
* @var array
*/
protected $middlewareGroups = [
'web' => [
\Illuminate\Cookie\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
// \Illuminate\Session\Middleware\AuthenticateSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\Illuminate\Foundation\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],

'api' => [
'throttle:api',
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
];
}

0 comments on commit 7beefe7

Please sign in to comment.