الملفات
Apartment-Booking-System/database/migrations/2025_11_25_142549_modify_users_table.php
Osama be6a3b607a feat: Authentication
- Update User model
- Create authentication controller
- Update api router
2025-11-30 20:06:51 +03:00

40 أسطر
1.1 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
// Remove email and add phone
// $table->dropColumn('email');
// $table->dropColumn('email_verified_at');
// Add our custom fields
$table->string('phone')->unique();
$table->enum('role', ['tenant', 'owner', 'admin'])->default('tenant');
$table->string('first_name');
$table->string('last_name');
$table->string('profile_image')->nullable();
$table->date('birth_date');
$table->string('id_image')->nullable();
$table->boolean('is_approved')->default(false);
$table->timestamp('approved_at')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
//
}
};