restore composer.json, add mysqli extension

This commit is contained in:
2026-04-15 17:02:52 +05:00
commit 77cf56a348
4317 changed files with 1397107 additions and 0 deletions

1
database/.gitignore vendored Executable file
View File

@@ -0,0 +1 @@
*.sqlite*

View File

@@ -0,0 +1,44 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Str;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User>
*/
class UserFactory extends Factory
{
/**
* The current password being used by the factory.
*/
protected static ?string $password;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'name' => fake()->name(),
'email' => fake()->unique()->safeEmail(),
'email_verified_at' => now(),
'password' => static::$password ??= Hash::make('password'),
'remember_token' => Str::random(10),
];
}
/**
* Indicate that the model's email address should be unverified.
*/
public function unverified(): static
{
return $this->state(fn(array $attributes) => [
'email_verified_at' => null,
]);
}
}

View File

@@ -0,0 +1,43 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUsersTable extends Migration
{
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('first_name')->nullable();
$table->string('last_name')->nullable();
$table->string('avatar')->nullable();
$table->string('password')->nullable();
$table->unsignedInteger('role_id')->default(2);
$table->string('email')->nullable();
$table->unsignedBigInteger('phone')->unique();
$table->unsignedInteger('verify_code')->nullable();
$table->boolean('verified')->default(false);
$table->boolean('gender')->default(true);
$table->timestamp('birth_day')->nullable();
$table->string('postal_address')->nullable();
$table->unsignedBigInteger('category_id')->nullable();
$table->boolean('notification')->default(true);
$table->string('language')->default('ru');
$table->unsignedInteger('step')->default(1);
$table->ipAddress('ip')->default('127.0.0.1');
$table->timestamp('deleted_at')->nullable();
//$table->rememberToken();
$table->timestamps();
});
}
public function down()
{
Schema::dropIfExists('users');
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePasswordResetsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('password_resets', function (Blueprint $table) {
$table->string('email')->index();
$table->string('token');
$table->timestamp('created_at')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('password_resets');
}
}

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateRegionsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('regions', function (Blueprint $table) {
$table->id();
$table->jsonb('name');
$table->boolean('cash')->default(false);
// $table->
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('regions');
}
}

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCitiesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('cities', function (Blueprint $table) {
$table->id();
$table->jsonb('name');
$table->unsignedBigInteger('region_id');
$table->timestamps();
$table->foreign('region_id')->references('id')->on('regions');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('cities');
}
}

View File

@@ -0,0 +1,38 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCategoriesTable extends Migration
{
public function up()
{
Schema::create('categories', function (Blueprint $table) {
$table->bigIncrements('id');
$table->jsonb('name');
$table->string('image')->nullable();
$table->string('slug');
$table->unsignedBigInteger('parent_id')->nullable();
$table->unsignedInteger('position')->default(0);
$table->boolean('credit')->default(true);
$table->boolean('popular')->default(false);
$table->jsonb('title_seo')->default('{"ru":"","uz":""}');
$table->jsonb('descriptions')->default('{"ru":"","uz":""}');
$table->jsonb('keywords')->default('{"ru":"","uz":""}');
$table->boolean('published')->default(true);
$table->timestamps();
$table->foreign('parent_id')
->references('id')
->on('categories')
->cascadeOnDelete();
});
}
public function down()
{
Schema::dropIfExists('categories');
}
}

View File

@@ -0,0 +1,31 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateAddressesTable extends Migration
{
public function up()
{
Schema::create('addresses', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedBigInteger('user_id');
$table->unsignedBigInteger('city_id');
// $table->bigInteger('phone');
$table->string('address')->nullable();
$table->string('home')->nullable();
$table->string('landmark')->nullable();
$table->softDeletes();
$table->timestamps();
$table->foreign('city_id')->references('id')->on('cities');
});
}
public function down()
{
Schema::dropIfExists('addresses');
}
}

View File

@@ -0,0 +1,25 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateFilesTable extends Migration
{
public function up()
{
Schema::create('files', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('name');
$table->string('path');
$table->string('path_thumb')->nullable();
$table->float('size');
$table->timestamps();
});
}
public function down()
{
Schema::dropIfExists('files');
}
}

View File

@@ -0,0 +1,43 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateOrdersTable extends Migration
{
public function up()
{
Schema::create('orders', function (Blueprint $table) {
$table->bigIncrements('id');
$table->integer('user_id');
$table->integer('branch_id')->nullable();
$table->string('full_name')->nullable();
$table->bigInteger('phone')->nullable();
$table->unsignedInteger('legal_id')->nullable();
$table->unsignedInteger('address_id')->nullable();
$table->boolean('with_installation')->default(false);
$table->enum('client_type', ['physical', 'legal'])->nullable();
$table->enum('payment_type', ['bank', 'cash', 'click', 'payme']);
$table->boolean('with_didox')->default(false);
$table->enum('delivery_type', ['delivery', 'pickup'])->default('delivery');
$table->timestamp('shipment_date')->nullable();
$table->timestamp('accepted_at')->nullable();
$table->jsonb('currency')->nullable();
$table->enum('status', ['processing', 'collected', 'waiting_buyer', 'in_way', 'closed', 'cancelled', 'replacement', 'completed'])->default('processing');
$table->enum('payment_status', ['waiting', 'cancelled', 'payed', 'cash', 'review'])->default('waiting');
$table->boolean('archived')->default(false);
$table->timestamps();
$table->softDeletes();
});
}
public function down()
{
Schema::dropIfExists('orders');
}
}

View File

@@ -0,0 +1,48 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
// Schema::create('orders_old', function (Blueprint $table) {
// $table->bigIncrements('id');
// $table->integer('user_id');
// $table->integer('address_id')->nullable();
//
// $table->integer('price_product')->default(0);
// $table->integer('price_delivery')->nullable();
// // $table->integer('price_product')->nullable();
// $table->integer('discount')->nullable();
// $table->boolean('archived')->default(false);
// $table->timestamp('shipment_date')->nullable();
// $table->enum('type', ['default', 'one_click'])->default('default');
// $table->enum('type_delivery', ['delivery', 'pickup'])->default('delivery');
// $table->jsonb('currency');
// $table->unsignedBigInteger('branch_id')->nullable();
// $table->jsonb('apelsin_data')->nullable();
// $table->enum('status', ['processing', 'collected', 'waiting_buyer', 'in_way', 'closed', 'cancelled', 'replacement', 'completed'])->default('processing');
//
// $table->enum('payment_type', ['cash', 'payme', 'apelsin', 'click', 'uzcard', 'oson', 'credit', 'upay', 'paynet'])->default('cash');
// $table->enum('payment_status', ['waiting', 'cancelled', 'payed', 'cash', 'review'])->default('waiting');
//
// $table->text('comment')->nullable();
//
// $table->timestamps();
// });
}
/**
* Reverse the migrations.
*/
public function down(): void
{
// Schema::dropIfExists('orders_old');
}
};

View File

@@ -0,0 +1,25 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateOrderProductsTable extends Migration
{
public function up()
{
Schema::create('order_products', function (Blueprint $table) {
$table->bigIncrements('id');
$table->integer('order_id');
$table->integer('product_id');
$table->integer('count')->default(1);
$table->decimal('price')->default(0);
$table->integer('discount')->nullable();
});
}
public function down()
{
Schema::dropIfExists('order_products');
}
}

View File

@@ -0,0 +1,24 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateBrendsTable extends Migration
{
public function up()
{
Schema::create('brands', function (Blueprint $table) {
$table->bigIncrements('id');
$table->jsonb('name');
$table->string('image');
$table->string('slug')->nullable();
$table->timestamps();
});
}
public function down()
{
Schema::dropIfExists('brands');
}
}

View File

@@ -0,0 +1,39 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateSettingsTable extends Migration
{
public function up()
{
Schema::create('settings', function (Blueprint $table) {
$table->bigIncrements('id');
$table->jsonb('title');
$table->jsonb('keywords');
$table->jsonb('description');
$table->jsonb('phone');
$table->string('email');
$table->boolean('buy_one')->default(true);
$table->jsonb('address');
$table->jsonb('socials');
$table->jsonb('other')->default('{"delivery":{"ru":"","uz":""},"pickup":{"ru":"","uz":""}}');
$table->boolean('pickup')->default(true);
$table->jsonb('permissions')->default('{"news": true, "middle_banner": true, "special_block":true,"lider_products":true,"popular_products":true,"new_products":true,"popular_categories":true,"brands":true}');
$table->boolean('on_credit')->default(false);
$table->boolean('delivery')->default(true);
$table->jsonb('pickup_text')->default('{"ru":"","uz":""}');
$table->integer('price_delivery')->default(10000);
$table->integer('day_delivery')->default(1);
$table->jsonb('landmark');
$table->jsonb('links')->nullable();
$table->timestamps();
});
}
public function down()
{
Schema::dropIfExists('settings');
}
}

View File

@@ -0,0 +1,58 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateProductsTable extends Migration
{
public function up()
{
Schema::create('products', function (Blueprint $table) {
$table->bigIncrements('id');
$table->jsonb('name')->nullable();
$table->jsonb('body')->nullable();
$table->jsonb('short_body')->nullable();
$table->float('price', 18)->default(0);
$table->float('price_discount', 18)->nullable();
//$table->string('category_id')->nullable();
$table->unsignedBigInteger('brand_id')->nullable();
$table->integer('views')->default(0);
$table->string('poster')->nullable();
$table->string('poster_thumb')->nullable();
$table->text('color_id')->nullable();
$table->integer('count')->default(0);
$table->boolean('available')->default(true);
$table->jsonb('sizes')->nullable();
$table->float('price_credit')->default(0);
// $table->jsonb('characteristics')->nul lable();
$table->jsonb('descriptions')->default('{"ru":"","uz":""}');
$table->jsonb('keywords')->default('{"ru":"","uz":""}');
$table->string('slug')->nullable();
$table->boolean('published')->default(false);
$table->unsignedBigInteger('child_id')->nullable();
$table->string('currency')->default('sum');
$table->jsonb('title_seo')->default('{"ru":"","uz":""}');
$table->boolean('popular')->default(false);
$table->boolean('leader_of_sales')->default(false);
$table->boolean('is_ready_solution')->default(false);
$table->string('article_number')->nullable();
$table->softDeletes();
$table->timestamps();
$table->foreign('brand_id')->references('id')->on('brands');
$table->foreign('child_id')->references('id')->on('products');
// $table->foreign('category_id')->references('id')->on('categories');
});
}
public function down()
{
Schema::dropIfExists('products');
}
}

View File

@@ -0,0 +1,29 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateScreensTable extends Migration
{
public function up()
{
Schema::create('screens', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('name');
$table->string('path');
$table->string('path_thumb')->nullable();
$table->integer('product_id');
$table->bigInteger('size')->default(0);
$table->string('type')->default('image/jpeg');
//$table->timestamps();
});
}
public function down()
{
Schema::dropIfExists('screens');
}
}

View File

@@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePersonalAccessTokensTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('personal_access_tokens', function (Blueprint $table) {
$table->bigIncrements('id');
$table->morphs('tokenable');
$table->string('name');
$table->string('token', 64)->unique();
$table->text('abilities')->nullable();
$table->timestamp('last_used_at')->nullable();
$table->timestamp('expires_at')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('personal_access_tokens');
}
}

View File

@@ -0,0 +1,43 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCategoriesBrandsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('categories_brands', function (Blueprint $table) {
//$table->bigIncrements('id');
$table->unsignedBigInteger('category_id');
$table->unsignedBigInteger('brand_id');
//$table->timestamps();
$table->foreign('category_id')
->references('id')->on('categories')
->onDelete('cascade');
$table->foreign('brand_id')
->references('id')->on('brands')
->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('categories_brands');
}
}

View File

@@ -0,0 +1,42 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateProductsUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('products_users', function (Blueprint $table) {
// $table->bigIncrements('id');
$table->unsignedBigInteger('product_id');
$table->unsignedBigInteger('user_id');
// $table->timestamps();
$table->foreign('user_id')
->references('id')->on('users')
->onDelete('cascade');
$table->foreign('product_id')
->references('id')->on('products')
->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('products_users');
}
}

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateColorsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('colors', function (Blueprint $table) {
$table->bigIncrements('id');
$table->jsonb('name');
$table->string('color', 100);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('colors');
}
}

View File

@@ -0,0 +1,39 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateBranchesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('branches', function (Blueprint $table) {
$table->id();
$table->jsonb('name');
$table->jsonb('address');
$table->jsonb('schedule');
$table->jsonb('orientation');
$table->jsonb('map');
$table->string('phone', 30);
$table->timestamps();
$table->timestamp('deleted_at')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('branches');
}
}

View File

@@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCompilationTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('compilations', function (Blueprint $table) {
$table->id();
$table->jsonb('title');
$table->integer('position')->default(1);
$table->unsignedBigInteger('category_id')->nullable();
$table->boolean('published')->default(false);
$table->timestamps();
$table->foreign('category_id')->references('id')->on('categories')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('compilation');
}
}

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCompilationProductsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('compilation_products', function (Blueprint $table) {
$table->unsignedBigInteger('compilation_id');
$table->unsignedBigInteger('product_id');
$table->foreign('compilation_id')->references('id')->on('compilations')->onDelete('cascade');
$table->foreign('product_id')->references('id')->on('products')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('compilation_products');
}
}

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCategoriesProductsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('categories_products', function (Blueprint $table) {
$table->unsignedBigInteger('category_id');
$table->unsignedBigInteger('product_id');
$table->foreign('category_id')->references('id')->on('categories')->onDelete('cascade');
$table->foreign('product_id')->references('id')->on('products')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('categories_products');
}
}

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCurrenciesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('currencies', function (Blueprint $table) {
$table->id();
$table->unsignedInteger('dollar');
$table->unsignedInteger('euro');
$table->unsignedInteger('sum')->default(1);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('currencies');
}
}

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateNotificationsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('notifications', function (Blueprint $table) {
$table->id();
$table->string('title');
$table->text('body');
$table->enum('language', ['ru', 'uz'])->default('ru');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('notifications');
}
}

View File

@@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateFirebasesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('firebases', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('user_id')->nullable();
$table->string('token');
$table->string('device_id');
$table->string('device_name');
$table->string('device_type');
// $table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('firebases');
}
}

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateRolesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('roles', function (Blueprint $table) {
$table->id();
$table->string('name', 100);
$table->jsonb('permissions');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('roles');
}
}

View File

@@ -0,0 +1,41 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateStaffTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('staff', function (Blueprint $table) {
$table->id();
// $table->string('name',144);
$table->string('username', 144)->unique();
$table->string('password');
$table->unsignedBigInteger('role_id')->default(1);
$table->rememberToken();
$table->boolean('block')->default(false);
$table->timestamps();
$table->foreign('role_id')
->references('id')
->on('roles')->cascadeOnDelete();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('staff');
}
}

View File

@@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePartnersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('partners', function (Blueprint $table) {
$table->id();
$table->jsonb('name', 100);
$table->jsonb('description')->nullable();
$table->string('video_url')->nullable();
$table->string('image');
$table->enum('status', ['published', 'new', 'soon'])->default('published');
$table->string('is_price')->default(false);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('partners');
}
}

View File

@@ -0,0 +1,41 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePostsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('posts', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('slug');
$table->string('language', 10)->default('ru');
$table->text('content');
$table->boolean('topped')->default(false);
$table->string('image');
$table->enum('type', ['news', 'article', 'sales', 'media']);
$table->text('keywords')->nullable();
$table->text('descriptions')->nullable();
$table->unsignedInteger('views')->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('posts');
}
}

View File

@@ -0,0 +1,40 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateSlidersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('sliders', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('image');
$table->string('language', 10)->default('ru');
$table->string('link');
$table->unsignedInteger('position')->default(0);
$table->boolean('published')->default(true);
$table->enum('type', ['desktop', 'mobile'])->default('desktop');
$table->enum('placement', ['top', 'middle'])->default('top');
$table->unsignedInteger('views')->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('sliders');
}
}

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateSpecialOffersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('special_offers', function (Blueprint $table) {
$table->id();
$table->jsonb('name');
$table->jsonb('description');
$table->string('link');
$table->string('image');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('special_offers');
}
}

View File

@@ -0,0 +1,43 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCommentsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('comments', function (Blueprint $table) {
$table->id();
$table->string('first_name');
$table->unsignedBigInteger('user_id')->nullable();
$table->unsignedBigInteger('product_id');
$table->text('body')->nullable();
$table->boolean('publish')->default(false);
$table->unsignedInteger('star')->default(0);
$table->timestamps();
$table->foreign('product_id')->references('id')->on('products')->onDelete('cascade');
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('comments');
}
}

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateFeedbackTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('feedback', function (Blueprint $table) {
$table->id();
$table->string('name', 100);
$table->string('phone', 30);
$table->text('message');
$table->boolean('viewed')->default(false);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('feedback');
}
}

View File

@@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePagesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('pages', function (Blueprint $table) {
$table->id();
$table->jsonb('name');
$table->string('slug');
$table->jsonb('body');
$table->jsonb('descriptions')->default('{"ru":"","uz":""}');
$table->jsonb('keywords')->default('{"ru":"","uz":""}');
$table->unsignedInteger('type')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('pages');
}
}

View File

@@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCartsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('carts', function (Blueprint $table) {
$table->id();
$table->string('token')->nullable();
$table->unsignedBigInteger('user_id')->nullable();
$table->unsignedBigInteger('product_id');
$table->integer('count')->default(1);
$table->string('size')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('carts');
}
}

View File

@@ -0,0 +1,40 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateBillingsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('billings', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('order_id');
$table->enum('status', ['payed', 'waiting', 'refused'])->default('waiting');
$table->integer('amount')->default(0);
$table->string('payment_system')->nullable();
$table->string('transaction_id')->nullable();
$table->softDeletes();
$table->timestamps();
$table->foreign('order_id')->references('id')->on('orders');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('billings');
}
}

View File

@@ -0,0 +1,41 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCharacteristicsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('characteristics', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('category_id');
$table->jsonb('name');
$table->enum('type', ['text', 'number', 'radio', 'checkbox', 'select']);
$table->jsonb('options')->nullable();
$table->boolean('filter')->default(false);
$table->timestamps();
$table->foreign('category_id')->references('id')->on('categories');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('characteristics');
}
}

View File

@@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCharacteristicsProductsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('characteristics_products', function (Blueprint $table) {
// $table->id();
$table->unsignedBigInteger('product_id');
$table->unsignedBigInteger('characteristic_id');
$table->string('value');
$table->foreign('product_id')->references('id')->on('products');
$table->foreign('characteristic_id')->references('id')->on('characteristics');
// $table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('characteristics_products');
}
}

View File

@@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCharacteristicsCategoriesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('characteristics_categories', function (Blueprint $table) {
// $table->id();
$table->unsignedBigInteger('characteristic_id');
$table->unsignedBigInteger('category_id');
$table->foreign('category_id')->references('id')->on('categories');
$table->foreign('characteristic_id')->references('id')->on('characteristics');
// $table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('characteristics_categories');
}
}

View File

@@ -0,0 +1,45 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePreviewsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('previews', function (Blueprint $table) {
$table->bigIncrements('id');
$table->jsonb('name')->nullable();
$table->float('price', 18)->default(0);
$table->float('price_discount', 18)->nullable();
$table->string('brand')->nullable();
$table->integer('category_id');
$table->jsonb('characteristics')->nullable();
$table->boolean('popular')->default(false);
$table->boolean('leader_of_sales')->default(false);
$table->string('article_number')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('previews');
}
}

View File

@@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateNotificationAvailablesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('notification_availables', function (Blueprint $table) {
$table->id();
$table->bigInteger('phone');
$table->unsignedBigInteger('product_id');
$table->timestamps();
$table->integer('sms')->default(2);
$table->foreign('product_id')
->references('id')->on('products')
->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('notification_availables');
}
}

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateActivityLogTable extends Migration
{
/**
* Run the migrations.
*/
public function up()
{
Schema::connection(config('activitylog.database_connection'))->create(config('activitylog.table_name'), function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('log_name')->nullable();
$table->text('description');
$table->nullableMorphs('subject', 'subject');
$table->string('event')->nullable();
$table->nullableMorphs('causer', 'causer');
$table->json('properties')->nullable();
$table->uuid('batch_uuid')->nullable();
$table->timestamps();
$table->index('log_name');
});
}
/**
* Reverse the migrations.
*/
public function down()
{
Schema::connection(config('activitylog.database_connection'))->dropIfExists(config('activitylog.table_name'));
}
}

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateOrdersCommentsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('orders_comments', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('order_id');
$table->unsignedBigInteger('user_id');
$table->text('comment');
$table->string('type');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('orders_comments');
}
}

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCommentsBankTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('comments_bank', function (Blueprint $table) {
$table->id();
$table->unsignedInteger('order_id');
$table->text('comment');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('comments_bank');
}
}

View File

@@ -0,0 +1,35 @@
<?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(): void
{
Schema::create('cache', function (Blueprint $table) {
$table->string('key')->primary();
$table->mediumText('value');
$table->integer('expiration');
});
Schema::create('cache_locks', function (Blueprint $table) {
$table->string('key')->primary();
$table->string('owner');
$table->integer('expiration');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('cache');
Schema::dropIfExists('cache_locks');
}
};

View 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
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('useful_infos', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('image')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('useful_infos');
}
};

View File

@@ -0,0 +1,33 @@
<?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(): void
{
Schema::create('useful_info_items', function (Blueprint $table) {
$table->id();
$table->bigInteger('useful_info_id');
$table->string('name');
$table->text('description')->nullable();
$table->string('video_url')->nullable();
$table->string('link_url')->nullable();
$table->string('file_url')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('useful_info_items');
}
};

View File

@@ -0,0 +1,33 @@
<?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(): void
{
Schema::create('partner_requests', function (Blueprint $table) {
$table->id();
$table->bigInteger('partner_id');
$table->bigInteger('city_id');
$table->decimal('price')->nullable();
$table->string('comment')->nullable();
$table->bigInteger('phone');
$table->string('full_name');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('partner_requests');
}
};

View File

@@ -0,0 +1,32 @@
<?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(): void
{
Schema::create('services', function (Blueprint $table) {
$table->id();
$table->jsonb('name');
$table->string('image');
$table->enum('status', ['new', 'soon', 'published'])->default('published');
$table->string('type');
$table->boolean('is_power')->default(false);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('services');
}
};

View 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
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('powers', function (Blueprint $table) {
$table->id();
$table->jsonb('name');
$table->integer('power');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('powers');
}
};

View File

@@ -0,0 +1,34 @@
<?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(): void
{
Schema::create('service_requests', function (Blueprint $table) {
$table->id();
$table->bigInteger('service_id')->unsigned();
$table->bigInteger('power_id')->unsigned()->nullable();
$table->bigInteger('city_id')->unsigned();
$table->string('comment')->nullable();
$table->bigInteger('phone');
$table->string('full_name');
// $table->unsignedInteger('user_id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('service_requests');
}
};

View File

@@ -0,0 +1,38 @@
<?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(): void
{
Schema::create('user_legal_infos', function (Blueprint $table) {
$table->id();
$table->bigInteger('user_id');
$table->string('company_name');
$table->string('inn');
$table->string('bank_name');
$table->string('mfo');
$table->string('oked');
$table->string('payment_account');
$table->string('address');
$table->string('email');
$table->string('phone');
$table->softDeletes();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('user_legal_infos');
}
};

View File

@@ -0,0 +1,34 @@
<?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(): void
{
Schema::table('products_users', function (Blueprint $table) {
$table->string('token')->nullable();
$table->unsignedBigInteger('user_id')->nullable()->change();
$table->index('token');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('products_users', function (Blueprint $table) {
$table->dropColumn('token');
$table->unsignedBigInteger('user_id')->nullable(false)->change();
$table->dropIndex('token');
});
}
};

View File

@@ -0,0 +1,28 @@
<?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(): void
{
Schema::table('services', function (Blueprint $table) {
$table->integer('position')->default(0);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('services', function (Blueprint $table) {
$table->dropColumn('position');
});
}
};

View File

@@ -0,0 +1,30 @@
<?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(): void
{
Schema::table('products', function (Blueprint $table) {
$table->string("data_sheet")->nullable();
$table->dropColumn('price_credit');
$table->dropColumn('popular');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('products', function (Blueprint $table) {
//
});
}
};

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\DB;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
// Truncate the 'useful_infos' table to remove all rows
DB::table('useful_infos')->truncate();
Schema::table('useful_infos', function (Blueprint $table) {
$table->dropColumn('name');
$table->json('name');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('useful_infos', function (Blueprint $table) {
$table->dropColumn('name');
$table->string('name');
});
}
};

View File

@@ -0,0 +1,40 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\DB;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
// Truncate the 'useful_info_items' table to remove all rows
DB::table('useful_info_items')->truncate();
Schema::table('useful_info_items', function (Blueprint $table) {
$table->dropColumn('name');
$table->json('name');
$table->dropColumn('description');
$table->json('description');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('useful_info_items', function (Blueprint $table) {
$table->dropColumn('name');
$table->string('name');
$table->dropColumn('description');
$table->string('description');
});
}
};

View File

@@ -0,0 +1,28 @@
<?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(): void
{
Schema::table('useful_info_items', function (Blueprint $table) {
$table->text('description')->nullable()->change();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('useful_info_items', function (Blueprint $table) {
$table->text('description')->nullable(false)->change();
});
}
};

View File

@@ -0,0 +1,31 @@
<?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(): void
{
Schema::table('service_requests', function (Blueprint $table) {
$table->unsignedInteger('user_id');
$table->string('status')->default('pending'); // pending, accepted, closed
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('service_requests', function (Blueprint $table) {
$table->dropColumn('user_id');
$table->dropColumn('deleted_at');
});
}
};

View File

@@ -0,0 +1,28 @@
<?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(): void
{
Schema::table('partner_requests', function (Blueprint $table) {
$table->string('status')->default('pending'); // pending, accepted, closed
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('partner_requests', function (Blueprint $table) {
$table->dropColumn('status');
});
}
};

View File

@@ -0,0 +1,34 @@
<?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(): void
{
Schema::table('orders', function (Blueprint $table) {
$table->bigInteger('price_products')->default(0);
$table->bigInteger('price_delivery')->default(0);
// $table->bigInteger('price_discount')->default(0);
$table->bigInteger('price_total')->default(0);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('orders', function (Blueprint $table) {
$table->dropColumn('price_products');
$table->dropColumn('price_delivery');
// $table->dropColumn('price_discount');
$table->dropColumn('price_total');
});
}
};

View File

@@ -0,0 +1,28 @@
<?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(): void
{
Schema::table('products', function (Blueprint $table) {
$table->integer('power')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('products', function (Blueprint $table) {
$table->dropColumn('power');
});
}
};

View File

@@ -0,0 +1,33 @@
<?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(): void
{
Schema::create('delivery_prices', function (Blueprint $table) {
$table->id();
$table->unsignedInteger('power_id');
$table->unsignedInteger('region_id')->nullable();
$table->bigInteger('price')->default(0);
$table->softDeletes();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('delivery_prices');
}
};

View File

@@ -0,0 +1,28 @@
<?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(): void
{
Schema::table('settings', function (Blueprint $table) {
$table->bigInteger('master_price')->default(0);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('settings', function (Blueprint $table) {
$table->dropColumn('master_price');
});
}
};

View File

@@ -0,0 +1,28 @@
<?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(): void
{
Schema::create('problems', function (Blueprint $table) {
$table->id();
$table->jsonb('title');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('problems');
}
};

View File

@@ -0,0 +1,31 @@
<?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(): void
{
Schema::create('service_problems', function (Blueprint $table) {
$table->id();
$table->bigInteger('service_id')->unsigned();
$table->foreign('service_id')->references('id')->on('services')->onDelete('cascade');
$table->bigInteger('problem_id')->unsigned();
$table->foreign('problem_id')->references('id')->on('problems')->onDelete('cascade');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('service_problems');
}
};

View File

@@ -0,0 +1,28 @@
<?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(): void
{
Schema::table('services', function (Blueprint $table) {
$table->boolean('with_problem')->default(false);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('services', function (Blueprint $table) {
$table->dropColumn('with_problem');
});
}
};

View File

@@ -0,0 +1,28 @@
<?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(): void
{
Schema::table('orders', function (Blueprint $table) {
$table->bigInteger('price_master')->default(0);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('orders', function (Blueprint $table) {
$table->dropColumn('price_master');
});
}
};

View File

@@ -0,0 +1,28 @@
<?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(): void
{
Schema::create('measurements', function (Blueprint $table) {
$table->id();
$table->jsonb('name');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('measurements');
}
};

View File

@@ -0,0 +1,30 @@
<?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(): void
{
Schema::create('contract_templates', function (Blueprint $table) {
$table->id();
$table->string('path');
$table->enum('lang', ['uz', 'ru'])->default('uz');
$table->enum('type', ['physical', 'legal'])->default('physical');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('contract_templates');
}
};

View File

@@ -0,0 +1,30 @@
<?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(): void
{
Schema::create('order_contracts', function (Blueprint $table) {
$table->id();
$table->bigInteger('order_id');
$table->enum('type', ['contract', 'master_contract']);
$table->string('path');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('order_contracts');
}
};

View File

@@ -0,0 +1,28 @@
<?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(): void
{
Schema::table('useful_infos', function (Blueprint $table) {
$table->unsignedInteger('position')->default(0);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('useful_infos', function (Blueprint $table) {
$table->dropColumn('position');
});
}
};

View File

@@ -0,0 +1,28 @@
<?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(): void
{
Schema::table('posts', function (Blueprint $table) {
$table->unsignedInteger('position')->default(0);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('posts', function (Blueprint $table) {
$table->dropColumn('position');
});
}
};

View File

@@ -0,0 +1,28 @@
<?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(): void
{
Schema::table('users', function (Blueprint $table) {
$table->string('middle_name')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('middle_name');
});
}
};

View 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
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('payment_system_models', function (Blueprint $table) {
$table->id();
$table->jsonb('title');
$table->string('slug')->unique();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('payment_system_models');
}
};

View File

@@ -0,0 +1,31 @@
<?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(): void
{
Schema::create('payment_system_items', function (Blueprint $table) {
$table->id();
$table->integer('payment_system_id');
$table->jsonb('title');
$table->string('logo');
$table->string('slug')->unique();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('payment_system_items');
}
};

View File

@@ -0,0 +1,28 @@
<?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(): void
{
Schema::table('payment_system_items', function (Blueprint $table) {
$table->json('description')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('payment_system_items', function (Blueprint $table) {
$table->dropColumn('description');
});
}
};

View File

@@ -0,0 +1,28 @@
<?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(): void
{
Schema::table('service_requests', function (Blueprint $table) {
$table->integer('problem_id')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('service_requests', function (Blueprint $table) {
$table->dropColumn('problem_id');
});
}
};

View File

@@ -0,0 +1,28 @@
<?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(): void
{
Schema::table('products', function (Blueprint $table) {
$table->unsignedInteger('measurement_id')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('products', function (Blueprint $table) {
$table->dropColumn('measurement_id');
});
}
};

View File

@@ -0,0 +1,34 @@
<?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(): void
{
Schema::create('companies', function (Blueprint $table) {
$table->id();
$table->string('company_name');
$table->string('inn');
$table->string('bank_name');
$table->string('mfo');
$table->string('oked');
$table->jsonb('address');
$table->string('director_full_name');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('companies');
}
};

View File

@@ -0,0 +1,28 @@
<?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(): void
{
Schema::table('user_legal_infos', function (Blueprint $table) {
$table->string('director_full_name')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('user_legal_infos', function (Blueprint $table) {
$table->dropColumn('director_full_name');
});
}
};

View File

@@ -0,0 +1,28 @@
<?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(): void
{
Schema::table('users', function (Blueprint $table) {
$table->dropUnique(['phone']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('users', function (Blueprint $table) {
$table->unique('phone');
});
}
};

View File

@@ -0,0 +1,28 @@
<?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(): void
{
Schema::table('addresses', function (Blueprint $table) {
$table->dropForeign(['city_id']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('addresses', function (Blueprint $table) {
$table->foreignId('city_id')->constrained();
});
}
};

View File

@@ -0,0 +1,28 @@
<?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(): void
{
Schema::table('cities', function (Blueprint $table) {
$table->dropForeign(['region_id']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('cities', function (Blueprint $table) {
$table->foreignId('region_id')->constrained();
});
}
};

View File

@@ -0,0 +1,30 @@
<?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(): void
{
Schema::create('statuses', function (Blueprint $table) {
$table->id();
$table->string('slug')->unique();
$table->string('font_color');
$table->string('bg_color');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('statuses');
}
};

View File

@@ -0,0 +1,30 @@
<?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(): void
{
Schema::table('companies', function (Blueprint $table) {
$table->string('payment_account')->nullable();
$table->string('phone')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('companies', function (Blueprint $table) {
$table->dropColumn('payment_account');
$table->dropColumn('phone');
});
}
};

View File

@@ -0,0 +1,30 @@
<?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(): void
{
Schema::table('partner_requests', function (Blueprint $table) {
$table->unsignedBigInteger('user_id')->nullable();
$table->foreign('user_id')->references('id')->on('users');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('partner_requests', function (Blueprint $table) {
$table->dropForeign(['user_id']);
$table->dropColumn('user_id');
});
}
};

View File

@@ -0,0 +1,28 @@
<?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(): void
{
Schema::table('settings', function (Blueprint $table) {
$table->string('group_id')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('settings', function (Blueprint $table) {
$table->dropColumn('group_id');
});
}
};

View File

@@ -0,0 +1,28 @@
<?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(): void
{
Schema::table('categories', function (Blueprint $table) {
$table->boolean('is_filter_power')->default(false);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('categories', function (Blueprint $table) {
$table->dropColumn('is_filter_power');
});
}
};

View File

@@ -0,0 +1,28 @@
<?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(): void
{
Schema::table("categories", function (Blueprint $table) {
$table->jsonb("company_name")->nullable();
$table->jsonb("director_full_namev")->nullable();
$table->jsonb("bank_name")->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
}
};

View File

@@ -0,0 +1,30 @@
<?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(): void
{
Schema::table("orders", function (Blueprint $table) {
$table->string("jshir", 255)->nullable();
$table->string("series", 255)->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table("orders", function (Blueprint $table) {
$table->dropColumn("jshir");
$table->dropColumn("series");
});
}
};

View File

@@ -0,0 +1,28 @@
<?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(): void
{
Schema::table("partners", function (Blueprint $table) {
$table->integer("position")->default(0);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table("partners", function (Blueprint $table) {
$table->dropColumn("position"); // drop the column
});
}
};

View File

@@ -0,0 +1,28 @@
<?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(): void
{
Schema::table("brands", function (Blueprint $table) {
$table->integer("position")->default(0);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table("brands", function (Blueprint $table) {
$table->dropColumn("position");
});
}
};

View File

@@ -0,0 +1,28 @@
<?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(): void
{
Schema::table("products", function (Blueprint $table) {
$table->string("calc")->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table("products", function (Blueprint $table) {
$table->dropColumn("calc");
});
}
};

View File

@@ -0,0 +1,31 @@
<?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(): void
{
Schema::table("categories", function (Blueprint $table) {
$table->enum("company", [
"getgreen",
"sunhightech"
])->default("getgreen");
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table("categories", function (Blueprint $table) {
$table->dropColumn("company");
});
}
};

View File

@@ -0,0 +1,31 @@
<?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(): void
{
Schema::table("contract_templates", function(Blueprint $table){
$table->enum("company",[
"getgreen",
"sunhightech"
])->default("getgreen");
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table("contract_templates", function(Blueprint $table){
$table->dropColumn("company");
});
}
};

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
class UpdateOrdersTable extends Migration
{
public function up()
{
Schema::table('orders', function (Blueprint $table) {
$table->string('payment_status')->default('waiting')->notNullable()->change();
});
DB::statement("
ALTER TABLE orders
ADD CONSTRAINT payment_status_check
CHECK (payment_status IN ('waiting', 'cancelled', 'payed', 'cash', 'review', 'processing'))
");
}
public function down()
{
DB::statement("
ALTER TABLE orders
DROP CONSTRAINT IF EXISTS payment_status_check
");
Schema::table('orders', function (Blueprint $table) {
$table->string('payment_status')->nullable()->default(null)->change();
});
}
}

View File

@@ -0,0 +1,69 @@
<?php
namespace Database\Seeders;
use App\Models\Brand;
use Illuminate\Database\Seeder;
class BrandSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
Brand::create([
'name' => [
'uz' => 'Apple',
'ru' => 'Яблоко',
],
"position"=>1,
'image' => 'apple.png',
]);
Brand::create([
'name' => [
'uz' => 'Samsung',
'ru' => 'Самсунг',
],
"position"=>2,
'image' => 'samsung.png',
]);
Brand::create([
'name' => [
'uz' => 'Xiaomi',
'ru' => 'Шаоми',
],
"position"=>3,
'image' => 'xiaomi.png',
]);
Brand::create([
'name' => [
'uz' => 'Huawei',
'ru' => 'Хуавей',
],
"position"=>4,
'image' => 'huawei.png',
]);
Brand::create([
'name' => [
'uz' => 'Nokia',
'ru' => 'Нокиа',
],
"position"=>5,
'image' => 'nokia.png',
]);
Brand::create([
'name' => [
'uz' => 'Sony',
'ru' => 'Сони',
],
"position"=>6,
'image' => 'sony.png',
]);
}
}

Some files were not shown because too many files have changed in this diff Show More