2017-12-03 00:55:17 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Events;
|
|
|
|
|
|
|
|
use App\Models\User;
|
|
|
|
use Illuminate\Broadcasting\InteractsWithSockets;
|
2018-02-21 12:33:09 +08:00
|
|
|
use Illuminate\Foundation\Events\Dispatchable;
|
|
|
|
use Illuminate\Queue\SerializesModels;
|
2017-12-03 00:55:17 +08:00
|
|
|
|
2017-12-23 06:32:21 +08:00
|
|
|
/**
|
|
|
|
* Event triggered when a user's state changes
|
|
|
|
*/
|
2017-12-03 00:55:17 +08:00
|
|
|
class UserStateChanged
|
|
|
|
{
|
|
|
|
use Dispatchable, InteractsWithSockets, SerializesModels;
|
|
|
|
|
2018-08-27 00:40:04 +08:00
|
|
|
public $old_state;
|
|
|
|
public $user;
|
2017-12-03 00:55:17 +08:00
|
|
|
|
2018-03-20 09:50:40 +08:00
|
|
|
/**
|
|
|
|
* UserStateChanged constructor.
|
2018-08-27 00:40:04 +08:00
|
|
|
*
|
2018-03-20 09:50:40 +08:00
|
|
|
* @param User $user
|
|
|
|
* @param $old_state
|
|
|
|
*/
|
2017-12-23 06:32:21 +08:00
|
|
|
public function __construct(User $user, $old_state)
|
2017-12-03 00:55:17 +08:00
|
|
|
{
|
2017-12-23 06:32:21 +08:00
|
|
|
$this->old_state = $old_state;
|
2017-12-03 00:55:17 +08:00
|
|
|
$this->user = $user;
|
|
|
|
}
|
|
|
|
}
|