mirror of
https://github.com/pixelfed/pixelfed.git
synced 2025-01-09 13:50:44 +00:00
Update asp
This commit is contained in:
parent
7290c56a4f
commit
ea17e24281
1 changed files with 16 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue