diff --git a/src/installation.md b/src/installation.md index d403755..ff8c1fb 100644 --- a/src/installation.md +++ b/src/installation.md @@ -24,8 +24,8 @@ Next, you may add the `laravel/spark-paddle` or `laravel/spark-stripe` package t ```json "require": { - "php": "^8.1", - "laravel/framework": "^10.0", + "php": "^8.2", + "laravel/framework": "^11.0", "laravel/spark-paddle": "^5.0" }, ``` @@ -95,8 +95,8 @@ If your Spark license has expired and you don't want to renew the license your ` ```json "require": { - "php": "^8.1", - "laravel/framework": "^10.0", + "php": "^8.2", + "laravel/framework": "^11.0", "laravel/spark-paddle": "5.y.z" }, ``` diff --git a/src/spark-paddle/customization.md b/src/spark-paddle/customization.md index d81146d..e348cd1 100644 --- a/src/spark-paddle/customization.md +++ b/src/spark-paddle/customization.md @@ -95,23 +95,3 @@ class PaddleEventListener } } ``` - -Next, the listener should be registered in your application's `App\Providers\EventServiceProvider` class: - -```php -use App\Listeners\PaddleEventListener; -use Laravel\Paddle\Events\WebhookReceived; - -class EventServiceProvider extends ServiceProvider -{ - /** - * The event handler mappings for the application. - * - * @var array - */ - protected $listen = [ - WebhookReceived::class => [ - PaddleEventListener::class, - ], - ]; -``` diff --git a/src/spark-paddle/middleware.md b/src/spark-paddle/middleware.md index 8fc3bd0..3badda9 100644 --- a/src/spark-paddle/middleware.md +++ b/src/spark-paddle/middleware.md @@ -2,20 +2,21 @@ [[toc]] -When building a subscription based application, you will commonly need to restrict access to certain routes to users that have a valid subscription. For example, you may not want to let a user create a project if they are not subscribed to a billing plan. For that reason, Spark provides a convenient subscription verification [middleware](https://laravel.com/docs/middleware) that you may register with your application. +When building a subscription based application, you will commonly need to restrict access to certain routes to users that have an active subscription. For example, you may not want to let a user create a project if they are not subscribed to a billing plan. For that reason, Spark provides a convenient subscription verification [middleware](https://laravel.com/docs/middleware) that you may assign to your application's routes. -To get started, register Spark's subscription verification middleware in your HTTP kernel's `$routeMiddleware` array. Your application's HTTP kernel is typically located at `app/Http/Kernel.php`: +If your application uses Laravel 11's streamlined application structure which configures middleware within the `bootstrap/app.php` file, then Spark's subscription verification middleware alias is automatically registered for you internally. However, if you are using an application structure that does not utilize the `bootstrap/app.php` file for middleware configuration, you may need to manually register the `subscribed` middleware alias in your application's `App\Http\Kernel` class: ```php use Spark\Http\Middleware\VerifyBillableIsSubscribed; -protected $routeMiddleware = [ +protected $middlewareAliases = [ // ... + 'subscribed' => VerifyBillableIsSubscribed::class ]; ``` -Once the middleware has been registered, you may attach it to any of your application's route definitions: +Then, you may attach the `subscribed` middleware to any of your application's route definitions: ```php Route::post('/projects', [ProjectController::class, 'store']) diff --git a/src/spark-stripe/customization.md b/src/spark-stripe/customization.md index d8d1394..fb90e59 100644 --- a/src/spark-stripe/customization.md +++ b/src/spark-stripe/customization.md @@ -101,23 +101,3 @@ class StripeEventListener } } ``` - -Next, the listener should be registered in your application's `App\Providers\EventServiceProvider` class: - -```php -use App\Listeners\StripeEventListener; -use Laravel\Cashier\Events\WebhookReceived; - -class EventServiceProvider extends ServiceProvider -{ - /** - * The event handler mappings for the application. - * - * @var array - */ - protected $listen = [ - WebhookReceived::class => [ - StripeEventListener::class, - ], - ]; -``` diff --git a/src/spark-stripe/middleware.md b/src/spark-stripe/middleware.md index 48166bc..2421031 100644 --- a/src/spark-stripe/middleware.md +++ b/src/spark-stripe/middleware.md @@ -2,20 +2,21 @@ [[toc]] -When building a subscription based application, you will commonly need to restrict access to certain routes to users that have an active subscription. For example, you may not want to let a user create a project if they are not subscribed to a billing plan. For that reason, Spark provides a convenient subscription verification [middleware](https://laravel.com/docs/middleware) that you may register with your application. +When building a subscription based application, you will commonly need to restrict access to certain routes to users that have an active subscription. For example, you may not want to let a user create a project if they are not subscribed to a billing plan. For that reason, Spark provides a convenient subscription verification [middleware](https://laravel.com/docs/middleware) that you may assign to your application's routes. -To get started, register Spark's subscription verification middleware in your HTTP kernel's `$routeMiddleware` array. Your application's HTTP kernel is typically located at `app/Http/Kernel.php`: +If your application uses Laravel 11's streamlined application structure which configures middleware within the `bootstrap/app.php` file, then Spark's subscription verification middleware alias is automatically registered for you internally. However, if you are using an application structure that does not utilize the `bootstrap/app.php` file for middleware configuration, you may need to manually register the `subscribed` middleware alias in your application's `App\Http\Kernel` class: ```php use Spark\Http\Middleware\VerifyBillableIsSubscribed; -protected $routeMiddleware = [ +protected $middlewareAliases = [ // ... + 'subscribed' => VerifyBillableIsSubscribed::class ]; ``` -Once the middleware has been registered, you may attach it to any of your application's route definitions: +Then, you may attach the `subscribed` middleware to any of your application's route definitions: ```php Route::post('/projects', [ProjectController::class, 'store'])