From 7982d5692efe8f74f2309c78157d4fee3ad57ec0 Mon Sep 17 00:00:00 2001 From: Christian Holladay Date: Thu, 21 Dec 2023 17:30:54 -0600 Subject: [PATCH] Create user statistics --- app/Providers/EventServiceProvider.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index b6c3b5e3..67a07ed0 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -13,7 +13,11 @@ use App\Listeners\Commission\Notification\SendCommissionArchivedNotification; use App\Listeners\Commission\Notification\SendCommissionCompletedNotification; use App\Listeners\Commission\Notification\SendCommissionCreatedNotification; +use App\Listeners\Commission\SetLastCommissionAtStatistic; use App\Listeners\CommissionMessage\ReceivedNotification; +use App\Listeners\Review\UpdateUserRatingStatistic; +use App\Listeners\User\SetLastLoginAtStatistic; +use Illuminate\Auth\Events\Login; use Illuminate\Auth\Events\Registered; use Illuminate\Auth\Listeners\SendEmailVerificationNotification; use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; @@ -30,6 +34,11 @@ class EventServiceProvider extends ServiceProvider Registered::class => [ SendEmailVerificationNotification::class, ], + // User login + Login::class => [ + SetLastLoginAtStatistic::class, + ], + // Commission Created::class => [ // @todo: add normal logic @@ -51,6 +60,7 @@ class EventServiceProvider extends ServiceProvider // @todo: add normal logic // @todo: move email here SendCommissionAcceptedNotification::class, + SetLastCommissionAtStatistic::class, ], // Commission Message Received Send::class => [ @@ -61,6 +71,15 @@ class EventServiceProvider extends ServiceProvider \App\Listeners\Ticket\Submitted\Email::class, ], + // Review created + \App\Events\Review\Created::class => [ + UpdateUserRatingStatistic::class + ], + // Review Updated + \App\Events\Review\Updated::class => [ + UpdateUserRatingStatistic::class + ], + /* @todo: * * Disputed