receive events from subscription package

This commit is contained in:
Čarodej
2021-11-08 15:54:38 +01:00
parent 0cc39f8575
commit eb22f25b07
2 changed files with 33 additions and 1 deletions
+10 -1
View File
@@ -1,10 +1,10 @@
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Event;
use Illuminate\Auth\Events\Registered;
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use Support\Listeners\SubscriptionEventSubscriber;
class EventServiceProvider extends ServiceProvider
{
@@ -19,6 +19,15 @@ class EventServiceProvider extends ServiceProvider
],
];
/**
* The subscriber classes to register.
*
* @var array
*/
protected $subscribe = [
SubscriptionEventSubscriber::class,
];
/**
* Register any events for your application.
*
@@ -0,0 +1,23 @@
<?php
namespace Support\Listeners;
use Illuminate\Events\Dispatcher;
use VueFileManager\Subscription\Support\Events\SubscriptionWasCreated;
class SubscriptionEventSubscriber
{
public function handleSubscriptionWasCreated($event) {
// TODO: set new storage size by subscribed plan
}
/**
* Register the listeners for the subscriber.
*/
public function subscribe(Dispatcher $events): array
{
return [
SubscriptionWasCreated::class => 'handleSubscriptionWasCreated',
];
}
}