<?php

namespace Modules\User\Events;

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

class UserUpdateIdentity
{

    use Dispatchable,
        SerializesModels;

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

    public Identity $before;

    public Identity $after;

    /**
     * 创建一个事件的实例
     *
     * @param  User  $user
     * @param  Identity  $before
     * @param  Identity  $after
     * @return void
     */
    public function __construct(User $user, Identity $before, Identity $after)
    {
        $this->user   = $user;
        $this->before = $before;
        $this->after  = $after;
    }

}
