phpvms/app/Events/UserStatsChanged.php

35 lines
730 B
PHP
Raw Normal View History

<?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;
/**
* Class UserStatsChanged
* @package App\Events
*/
class UserStatsChanged
{
use Dispatchable, InteractsWithSockets, SerializesModels;
public $stat_name,
$old_value,
$user;
/*
* When a user's stats change. Stats changed match the field name:
* airport
* flights
* rank
*/
public function __construct(User $user, $stat_name, $old_value)
{
$this->user = $user;
$this->stat_name = $stat_name;
$this->old_value = $old_value;
}
}