我有用户表,其中包含有关用户及其角色的信息,因此这里的唯一是“电子邮件”,“role_id”,“电话”组合在一起,因此电子邮件可以复制,但如果role_id和电话号码重复,则不能重复,这是因为用户可以是客户,这意味着role_id = 1,或者他将帐户作为企业帐户,这意味着role_id = 2,但如果此客户需要重置其客户怎么办密码,还是他的企业帐户密码?我该怎么做?
桌子
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();
});
梵蒂冈之花