Update asp

This commit is contained in:
Daniel Supernault 2025-01-04 00:52:24 -07:00
parent 7290c56a4f
commit ea17e24281
No known key found for this signature in database
GPG key ID: 23740873EE6F76A1

View file

@ -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);
}