<?php

namespace Modules\User\Events;

use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Http\Request;
use Illuminate\Queue\SerializesModels;
use Modules\User\Models\User;

class UserLoginSuccess
{

    use Dispatchable,
        SerializesModels;

    /**
     * 用户模型
     *
     * @var User
     */
    public User $user;

    /**
     * 当前请求
     *
     * @var Request
     */
    public Request $request;

    /**
     * 登录渠道
     *
     * @var string
     */
    public string $gateway;

    /**
     * 创建一个事件的实例
     *
     * @param  User  $user
     * @param  Request  $request
     * @param  string  $gateway
     */
    public function __construct(User $user, Request $request, string $gateway = '')
    {
        $this->user    = $user;
        $this->request = $request;
        $this->gateway = $gateway;
    }

}
