Edit File: 2023_10_22_151626_create_providers_table.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. * * @return void */ public function up() { Schema::create('providers', function (Blueprint $table) { $table->id(); $table->string('name',50); $table->text('store_name')->nullable(); // translatable $table->text('store_description')->nullable(); // translatable $table->string('email',50)->nullable(); $table->string('country_code',5)->default('966'); $table->string('phone',15); $table->string('whatsapp_country_code',5)->default('966'); $table->string('whatsapp_phone',15)->nullable(); $table->string('password',100)->nullable(); $table->string('image', 50)->default('default.png'); $table->string('logo', 50)->default('default.png'); $table->string('civil_registration_number',100)->nullable(); $table->string('identity_number',100)->nullable(); $table->string('tax_number',100)->nullable(); $table->double('avg_rate', 9, 2)->default(0); $table->string('preparing_time')->default('من 10 دقيقة الى 20 دقيقة'); $table->boolean('active')->default(0); $table->unsignedDouble('minimum_order')->default(1); $table->boolean('is_blocked')->default(0); $table->boolean('is_approved')->default(1); $table->tinyInteger('delivery_method')->default(2); $table->boolean('is_available_to_recieve_orders')->default(0); $table->boolean('is_notify')->default(true); $table->boolean('is_busy')->default(false); $table->string('lang', 2)->default('ar'); // This for Category ID should be from roots category $table->foreignId('category_id')->nullable()->constrained()->onDelete('cascade'); $table->foreignId('city_id')->nullable()->constrained()->onDelete('cascade'); $table->foreignId('neighborhood_id')->nullable()->constrained()->onDelete('cascade'); $table->decimal('lat', 10, 8)->nullable(); $table->decimal('lng', 10, 8)->nullable(); $table->string('map_desc', 50)->nullable(); $table->string('code', 10)->nullable(); $table->timestamp('code_expire')->nullable(); $table->softDeletes(); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('providers'); } };
Back to File Manager