diff --git a/composer.json b/composer.json index ea487d3..7079b3e 100644 --- a/composer.json +++ b/composer.json @@ -15,18 +15,18 @@ } ], "require": { - "php": "^8.0.2", - "illuminate/database": "^9.19", - "illuminate/http": "^9.19", - "illuminate/routing": "^9.19", - "illuminate/support": "^9.19", + "php": "^8.2 || ^8.1 || ^8.0", + "illuminate/database": "^11.19 || ^10.19 || ^9.19", + "illuminate/http": "^11.19 || ^10.19 || ^9.19", + "illuminate/routing": "^11.19 || ^10.19 || ^9.19", + "illuminate/support": "^11.0 || ^10.0 || ^9.0", "nesbot/carbon": "^2.62.1", "quickbooks/v3-php-sdk": "^5.4.6" }, "require-dev": { "laravel/pint": "^1.2", - "mockery/mockery": "^1.5.1", - "phpunit/phpunit": "^9.5.8", + "mockery/mockery": "^1.6 || ^1.5", + "phpunit/phpunit": "^10.5 || ^9.5", "psy/psysh": "^0.11", "scrutinizer/ocular": "^1.9" }, diff --git a/config/quickbooks.php b/config/quickbooks.php index 0dcfd0d..1de707b 100644 --- a/config/quickbooks.php +++ b/config/quickbooks.php @@ -91,6 +91,7 @@ 'owner' => 'id', ], 'model' => User::class, + 'guard' => 'auth', ], ]; diff --git a/src/Providers/ClientServiceProvider.php b/src/Providers/ClientServiceProvider.php index fefd4a4..ee7b81e 100644 --- a/src/Providers/ClientServiceProvider.php +++ b/src/Providers/ClientServiceProvider.php @@ -30,9 +30,12 @@ public function provides(): array public function register(): void { $this->app->bind(Client::class, function (Application $app) { + $config = $this->app->config->get('quickbooks.user'); + $token = - $app->auth->user()->quickBooksToken ?: + $app->auth->guard($config['guard'])->user()->quickBooksToken ?: $app->auth + ->guard($config['guard']) ->user() ->quickBooksToken() ->make();