se modifica modelo para agregar tokens unsubscribed

This commit is contained in:
2026-02-20 16:26:51 -06:00
parent cc6e23407b
commit 4658c11367
+8
View File
@@ -33,6 +33,7 @@ class User extends Authenticatable
'password', 'password',
'code', 'code',
'status', 'status',
'unsubscribe_token'
]; ];
@@ -100,4 +101,11 @@ class User extends Authenticatable
return $this->belongsToMany(Prospecto::class); return $this->belongsToMany(Prospecto::class);
} }
protected static function booted()
{
static::creating(function ($user) {
$user->unsubscribe_token ??= \Illuminate\Support\Str::uuid();
});
}
} }