From ea17e2428179a370b559c7f836b3607a722dbb3f Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 4 Jan 2025 00:52:24 -0700 Subject: [PATCH] Update asp --- app/Providers/AppServiceProvider.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 87d0ceb05..a8abc99c7 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -20,6 +20,7 @@ use App\Observers\StatusObserver; use App\Observers\UserFilterObserver; use App\Observers\UserObserver; use App\Profile; +use App\Services\AccountService; use App\Status; use App\StatusHashtag; use App\User; @@ -32,6 +33,7 @@ use Illuminate\Support\Facades\Gate; use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Validator; use Illuminate\Support\ServiceProvider; +use Laravel\Pulse\Facades\Pulse; use URL; class AppServiceProvider extends ServiceProvider @@ -69,6 +71,20 @@ class AppServiceProvider extends ServiceProvider return $user->is_admin === 1; }); + Pulse::user(function ($user) { + $acct = AccountService::get($user->profile_id, true); + + return $acct ? [ + 'name' => $acct['username'], + 'extra' => $user->email, + 'avatar' => $acct['avatar'], + ] : [ + 'name' => $user->username, + 'extra' => 'DELETED', + 'avatar' => '/storage/avatars/default.jpg', + ]; + }); + // Model::preventLazyLoading(true); }