12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- namespace App\Events;
- use App\Models\User\UserModel;
- use Illuminate\Queue\SerializesModels;
- use Illuminate\Broadcasting\PrivateChannel;
- use Illuminate\Foundation\Events\Dispatchable;
- use Illuminate\Broadcasting\InteractsWithSockets;
- /**
- * 提醒补全信息
- * Class CompleteInfoRemind
- * @package App\Events
- */
- class CompleteInfoRemind
- {
- use Dispatchable;
- use InteractsWithSockets;
- use SerializesModels;
- /** @var UserModel 被提醒用户 */
- public $is_remind_user;
- public $remind_nickname;
- /**
- * Create a new event instance.
- *
- * @param UserModel $is_remind_user
- * @param string $remind_nickname
- */
- public function __construct(UserModel $is_remind_user, string $remind_nickname)
- {
- $this->is_remind_user = $is_remind_user;
- $this->remind_nickname = $remind_nickname;
- }
- /**
- * Get the channels the event should broadcast on.
- *
- * @return \Illuminate\Broadcasting\Channel|array
- */
- public function broadcastOn()
- {
- return new PrivateChannel('channel-name');
- }
- }
|