| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <?php
- namespace App\Module\System\Events;
- use App\Module\System\Models\AppConfig;
- use Illuminate\Broadcasting\InteractsWithSockets;
- use Illuminate\Foundation\Events\Dispatchable;
- use Illuminate\Queue\SerializesModels;
- /**
- * 配置变更事件
- */
- class ConfigChangedEvent
- {
- use Dispatchable, InteractsWithSockets, SerializesModels;
- /**
- * 配置键名
- *
- * @var string
- */
- public string $keyname;
- /**
- * 旧值
- *
- * @var mixed
- */
- public $oldValue;
- /**
- * 新值
- *
- * @var mixed
- */
- public $newValue;
- /**
- * 配置对象
- *
- * @var AppConfig
- */
- public AppConfig $config;
- /**
- * 管理员ID
- *
- * @var int
- */
- public int $adminId;
- /**
- * 创建一个新的事件实例
- *
- * @param AppConfig $config
- * @param mixed $oldValue
- * @param int $adminId
- * @return void
- */
- public function __construct(AppConfig $config, $oldValue, int $adminId = 0)
- {
- $this->keyname = $config->keyname;
- $this->oldValue = $oldValue;
- $this->newValue = $config->value;
- $this->config = $config;
- $this->adminId = $adminId;
- }
- }
|