在我的用户模型中我可以这样做:
public function sendPasswordResetNotification($token)
{
$message = (new UserForgotPassword($this->email, $this->name, $token));
}
但我怎样才能传递完整的User对象呢?
public function sendPasswordResetNotification($token)
{
$message = (new UserForgotPassword($user, $token));
}
使用$user不起作用,但它确实适用于:
protected static function booted()
{
static::creating(function ($user) {
$user->uuid = Str::uuid();
});
}
30秒到达战场
慕姐4208626