fix: hapus unique constraint email agar 1 email bisa dipakai banyak orang
This commit is contained in:
parent
077f47a7d2
commit
65f070ecaf
|
|
@ -12,7 +12,7 @@ public function store(Request $request)
|
|||
{
|
||||
$request->validate([
|
||||
'name' => 'required|string|max:255',
|
||||
'email' => 'required|email|max:255|unique:user_profiles,email',
|
||||
'email' => 'required|email|max:255',
|
||||
'gender' => 'required|in:laki-laki,perempuan',
|
||||
'day' => 'required|integer|min:1|max:31',
|
||||
'month' => 'required|integer|min:1|max:12',
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
* Hapus constraint unique pada kolom email agar 1 email bisa dipakai banyak orang.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('user_profiles', function (Blueprint $table) {
|
||||
$table->dropUnique('user_profiles_email_unique');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('user_profiles', function (Blueprint $table) {
|
||||
$table->unique('email');
|
||||
});
|
||||
}
|
||||
};
|
||||
Loading…
Reference in New Issue