mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
laravel echo
This commit is contained in:
@@ -16,7 +16,7 @@ class PlebLoggedInEvent implements ShouldBroadcast
|
||||
* Create a new event instance.
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(public string $name)
|
||||
public function __construct(public string $name, public string $img)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
@@ -14,7 +14,16 @@ class LaravelEcho extends Component
|
||||
public function plebLoggedIn($data)
|
||||
{
|
||||
$this->notification()
|
||||
->success(title: 'Pleb alert!', description: $data['name'].' logged in');
|
||||
->confirm([
|
||||
'img' => $data['img'],
|
||||
'title' => 'Pleb alert!',
|
||||
'description' => $data['name'].' logged in',
|
||||
'icon' => 'bell',
|
||||
'acceptLabel' => '',
|
||||
'rejectLabel' => '',
|
||||
'iconColor' => 'primary',
|
||||
'timeout' => 60000,
|
||||
]);
|
||||
}
|
||||
|
||||
public function render()
|
||||
|
||||
@@ -26,6 +26,6 @@ class AddLoginReputation
|
||||
public function handle($event)
|
||||
{
|
||||
$event->user->givePoint(new LoggedIn($event->user));
|
||||
event(new PlebLoggedInEvent($event->user->name));
|
||||
event(new PlebLoggedInEvent($event->user->name, $event->user->profile_photo_url));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user