mirror of
https://github.com/wearepixel/laravel-quickbooks.git
synced 2026-11-14 14:01:46 +00:00
feat: add Laravel 11/12 and PHP 8.3+ support
- Widen illuminate/* deps to ^10.0|^11.0|^12.0, require PHP ^8.3 - Upgrade PHPUnit to ^10.5|^11.0, Mockery to ^1.6 - Rewrite phpunit.xml.dist for PHPUnit 10+ format (source/include replaces filter/whitelist, removed deprecated attributes) - Replace $dates with $casts on Token model - Implement DeferrableProvider interface instead of $defer property on ClientServiceProvider - Use FQCN route definitions instead of string-based namespace() - Fix migration getColumnType() check for Laravel 11+ native types - Replace @test doc annotations with #[Test] attributes - Fix dynamic property deprecation in ControllerTest
This commit is contained in:
@@ -22,8 +22,7 @@ public function __construct(
|
||||
protected Redirector $redirector,
|
||||
protected Session $session,
|
||||
protected UrlGenerator $url_generator,
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
|
||||
@@ -3,19 +3,15 @@
|
||||
namespace Wearepixel\QuickBooks\Providers;
|
||||
|
||||
use Illuminate\Contracts\Foundation\Application;
|
||||
use Illuminate\Contracts\Support\DeferrableProvider;
|
||||
use Illuminate\Support\ServiceProvider as LaravelServiceProvider;
|
||||
use Wearepixel\QuickBooks\Client;
|
||||
|
||||
/**
|
||||
* Class ClientServiceProvider
|
||||
*/
|
||||
class ClientServiceProvider extends LaravelServiceProvider
|
||||
class ClientServiceProvider extends LaravelServiceProvider implements DeferrableProvider
|
||||
{
|
||||
/**
|
||||
* Indicates if loading of the provider is deferred.
|
||||
*/
|
||||
protected bool $defer = true;
|
||||
|
||||
/**
|
||||
* Get the services provided by the provider.
|
||||
*/
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
namespace Wearepixel\QuickBooks\Providers;
|
||||
|
||||
use Illuminate\Routing\Router;
|
||||
use Illuminate\Support\ServiceProvider as LaravelServiceProvider;
|
||||
use Wearepixel\QuickBooks\Http\Controllers\Controller;
|
||||
use Wearepixel\QuickBooks\Http\Middleware\Filter;
|
||||
|
||||
/**
|
||||
@@ -89,19 +89,20 @@ protected function registerRoutes(): void
|
||||
->prefix($config['prefix'])
|
||||
->as('quickbooks.')
|
||||
->middleware($config['middleware']['default'])
|
||||
->namespace('Wearepixel\QuickBooks\Http\Controllers')
|
||||
->group(function (Router $router) use ($config) {
|
||||
$router
|
||||
->get($config['paths']['connect'], 'Controller@connect')
|
||||
->group(function () use ($config) {
|
||||
$this->app->router
|
||||
->get($config['paths']['connect'], [Controller::class, 'connect'])
|
||||
->middleware($config['middleware']['authenticated'])
|
||||
->name('connect');
|
||||
|
||||
$router
|
||||
->delete($config['paths']['disconnect'], 'Controller@disconnect')
|
||||
$this->app->router
|
||||
->delete($config['paths']['disconnect'], [Controller::class, 'disconnect'])
|
||||
->middleware($config['middleware']['authenticated'])
|
||||
->name('disconnect');
|
||||
|
||||
$router->get($config['paths']['token'], 'Controller@token')->name('token');
|
||||
$this->app->router
|
||||
->get($config['paths']['token'], [Controller::class, 'token'])
|
||||
->name('token');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
+6
-3
@@ -34,11 +34,14 @@ class Token extends Model
|
||||
protected $table = 'quickbooks_tokens';
|
||||
|
||||
/**
|
||||
* The attributes that should be mutated to dates.
|
||||
* The attributes that should be cast.
|
||||
*
|
||||
* @var array
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected $dates = ['access_token_expires_at', 'refresh_token_expires_at'];
|
||||
protected $casts = [
|
||||
'access_token_expires_at' => 'datetime',
|
||||
'refresh_token_expires_at' => 'datetime',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
|
||||
Reference in New Issue
Block a user