أُنشئ من Tokal/Test
Initial backend upload
هذا الالتزام موجود في:
29
database/migrations/2026_02_13_074913_update_users_table.php
Normal file
29
database/migrations/2026_02_13_074913_update_users_table.php
Normal file
@@ -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
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
// نحذف name الافتراضي
|
||||
$table->dropColumn('name');
|
||||
|
||||
// نضيف الحقول تبع مشروعنا
|
||||
$table->string('first_name')->after('id');
|
||||
$table->string('last_name')->after('first_name');
|
||||
$table->string('phone')->unique()->after('email');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->string('name');
|
||||
$table->dropColumn(['first_name', 'last_name', 'phone']);
|
||||
});
|
||||
}
|
||||
};
|
||||
المرجع في مشكلة جديدة
حظر مستخدم