我有用戶(hù)表,其中包含有關(guān)用戶(hù)及其角色的信息,所以這里唯一的是 'email'、'role_id'、'phone' 組合在一起,所以電子郵件可以重復(fù)但如果 role_id 和電話(huà)號(hào)碼重復(fù)則不能重復(fù),這是因?yàn)橛脩?hù)可以是客戶(hù),即role_id=1,或者他的帳戶(hù)是企業(yè)帳戶(hù),即role_id=2,但是如果該客戶(hù)需要重置其客戶(hù)密碼或企業(yè)帳戶(hù)密碼怎么辦?我怎樣才能做到這一點(diǎn)?桌子 Schema::create('users', function (Blueprint $table) { $table->engine = 'InnoDB'; $table->increments('id'); $table->string('fname'); $table->string('lname'); $table->boolean('role_id')->default(1); $table->string('phone'); $table->string('email'); $table->unique(['email', 'role_id','phone']); $table->string('password'); $table->boolean('status')->default(1); $table->rememberToken(); $table->timestamp('email_verified_at')->nullable(); $table->timestamps(); });
Laravel,如何將密碼重置為用戶(hù)表中重復(fù)的電子郵件
呼喚遠(yuǎn)方
2022-07-29 16:53:53