From cc3f814dd7a21e2c9218fc4563e3bbd7529fa1ac Mon Sep 17 00:00:00 2001 From: "iVampireSP.com" Date: Thu, 2 Feb 2023 01:56:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20UUID=20=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E7=94=9F=E6=88=90=E7=9A=84=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/User.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Models/User.php b/app/Models/User.php index 714df2b..799f13a 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -7,6 +7,7 @@ use Carbon\Exceptions\InvalidFormatException; use GeneaLabs\LaravelModelCaching\CachedBuilder; use GeneaLabs\LaravelModelCaching\Traits\Cachable; +use Illuminate\Auth\MustVerifyEmail; use Illuminate\Contracts\Encryption\DecryptException; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Casts\Attribute; @@ -17,11 +18,12 @@ use Illuminate\Notifications\Notifiable; use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Crypt; +use Illuminate\Support\Str; use Laravel\Sanctum\HasApiTokens; class User extends Authenticatable { - use HasApiTokens, HasFactory, Notifiable, Cachable; + use HasApiTokens, HasFactory, Notifiable, Cachable, MustVerifyEmail; public array $publics = [ 'id', @@ -76,6 +78,7 @@ protected static function boot() static::creating(function (self $user) { $user->email_md5 = md5($user->email); + $user->uuid = Str::uuid(); }); static::updating(function (self $user) {