Edit File: 2023_10_22_083051_create_users_table.php
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateUsersTable extends Migration { public function up() { Schema::create('users', function (Blueprint $table) { $table->id(); $table->string('name',50); $table->string('country_code',5)->default('966'); $table->string('phone',15); $table->string('email',50)->nullable(); $table->string('image', 50)->default('default.png'); $table->foreignId('city_id')->constrained('cities')->onDelete('cascade'); $table->foreignId('neighborhood_to_delivered_id')->nullable()->constrained('neighborhoods')->onDelete('cascade'); $table->boolean('active')->default(0); $table->boolean('is_blocked')->default(0); $table->boolean('is_approved')->default(1); $table->string('lang', 2)->default('ar'); $table->boolean('is_notify')->default(true); $table->boolean('is_busy')->default(false); $table->string('code', 10)->nullable(); $table->timestamp('code_expire')->nullable(); $table->decimal('lat', 10, 8)->nullable(); $table->decimal('lng', 10, 8)->nullable(); $table->string('map_desc', 50)->nullable(); $table->double('avg_rate', 9, 2)->default(0); $table->decimal('wallet_balance', 9,2)->default(0); $table->softDeletes(); $table->timestamps(); }); } public function down() { Schema::dropIfExists('users'); } }
Back to File Manager