Fixes and cleanup for user pending/registration calls
This commit is contained in:
@@ -7,14 +7,19 @@ use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
use Illuminate\Broadcasting\InteractsWithSockets;
|
||||
|
||||
/**
|
||||
* Event triggered when a user's state changes
|
||||
* @package App\Events
|
||||
*/
|
||||
class UserStateChanged
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
|
||||
public $user;
|
||||
public $old_state, $user;
|
||||
|
||||
public function __construct(User $user)
|
||||
public function __construct(User $user, $old_state)
|
||||
{
|
||||
$this->old_state = $old_state;
|
||||
$this->user = $user;
|
||||
}
|
||||
}
|
||||
|
||||
29
app/Events/UserStatsChanged.php
Normal file
29
app/Events/UserStatsChanged.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Events;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
use Illuminate\Broadcasting\InteractsWithSockets;
|
||||
|
||||
class UserStatsChanged
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
|
||||
public $stat_name,
|
||||
$old_value,
|
||||
$user;
|
||||
|
||||
/*
|
||||
* When a user's stats change. Stats changed match the field name:
|
||||
* flights
|
||||
* rank
|
||||
*/
|
||||
public function __construct(User $user, $stat_name, $old_value)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->stat_name = $stat_name;
|
||||
$this->old_value = $old_value;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user