Refactor code for consistency and clarity; update seeder comments, enhance error handling, and improve API routes. Added 'original' field to ProductMediaResource and adjusted various formatting issues across multiple files.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('selected_categories', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->jsonb('name');
|
||||
$table->jsonb('description')->nullable();
|
||||
$table->boolean('is_visible')->default(true);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('selected_categories');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('category_selected_category', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('selected_category_id')->constrained()->cascadeOnDelete();
|
||||
$table->foreignId('category_id')->constrained()->cascadeOnDelete();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('category_selected_category');
|
||||
}
|
||||
};
|
||||
@@ -33,26 +33,26 @@ class DatabaseSeeder extends Seeder
|
||||
public function run(): void
|
||||
{
|
||||
$this->call([
|
||||
PaymentTypeSeeder::class,
|
||||
// PaymentTypeSeeder::class,
|
||||
UsersTableSeeder::class,
|
||||
BrandsSeeder::class,
|
||||
CustomersTableSeeder::class,
|
||||
SellersTableSeeder::class,
|
||||
ProductsTableSeeder::class,
|
||||
ProductPricesSeeder::class,
|
||||
CategoriesTableSeeder::class,
|
||||
AddressSeeder::class,
|
||||
PropertiesTableSeeder::class,
|
||||
FavoritesSeeder::class,
|
||||
SectionsSeeder::class,
|
||||
ProductCategoryRelationshipsSeeder::class,
|
||||
ProductBarcodesSeeder::class,
|
||||
ProductPropertiesSeeder::class,
|
||||
ProductPropertyValuesSeeder::class,
|
||||
ProductStocksSeeder::class,
|
||||
MediaSeeder::class,
|
||||
OrderSeeder::class,
|
||||
OrderAddressSeeder::class,
|
||||
// BrandsSeeder::class,
|
||||
// CustomersTableSeeder::class,
|
||||
// SellersTableSeeder::class,
|
||||
// ProductsTableSeeder::class,
|
||||
// ProductPricesSeeder::class,
|
||||
// CategoriesTableSeeder::class,
|
||||
// AddressSeeder::class,
|
||||
// PropertiesTableSeeder::class,
|
||||
// FavoritesSeeder::class,
|
||||
// SectionsSeeder::class,
|
||||
// ProductCategoryRelationshipsSeeder::class,
|
||||
// ProductBarcodesSeeder::class,
|
||||
// ProductPropertiesSeeder::class,
|
||||
// ProductPropertyValuesSeeder::class,
|
||||
// ProductStocksSeeder::class,
|
||||
// MediaSeeder::class,
|
||||
// OrderSeeder::class,
|
||||
// OrderAddressSeeder::class,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ namespace Database\Seeders;
|
||||
use App\Models\System\Settings\Payments\PaymentType;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
|
||||
class PaymentTypeSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
@@ -38,6 +37,6 @@ class PaymentTypeSeeder extends Seeder
|
||||
'is_enabled' => true,
|
||||
'options' => null,
|
||||
],
|
||||
])->each(fn($data) => PaymentType::create($data));
|
||||
])->each(fn ($data) => PaymentType::create($data));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ class UsersTableSeeder extends Seeder
|
||||
*/
|
||||
public function seedStarterKit(): void
|
||||
{
|
||||
$this->seedRoles();
|
||||
// $this->seedRoles();
|
||||
|
||||
collect([
|
||||
[
|
||||
@@ -39,7 +39,7 @@ class UsersTableSeeder extends Seeder
|
||||
$user->assignRole('admin');
|
||||
});
|
||||
|
||||
$this->createChannels();
|
||||
// $this->createChannels();
|
||||
}
|
||||
|
||||
public function seedRoles(): void
|
||||
|
||||
@@ -35,7 +35,7 @@ class MediaSeeder extends Seeder
|
||||
}
|
||||
|
||||
DB::table($table)->insert([
|
||||
"id" => $data['id'],
|
||||
'id' => $data['id'],
|
||||
'model_type' => $modelType,
|
||||
'model_id' => $data['model_id'],
|
||||
'uuid' => $data['uuid'],
|
||||
@@ -61,4 +61,4 @@ class MediaSeeder extends Seeder
|
||||
");
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace Database\Seeders\New;
|
||||
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use JsonMachine\Items;
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace Database\Seeders\New;
|
||||
|
||||
use App\Models\Ecommerce\Product\Order\Payment\OrderPayment;
|
||||
use App\Models\Ecommerce\Product\Order\Shipping\OrderShipping;
|
||||
use App\Models\Ecommerce\Product\Order\Status\OrderStatus;
|
||||
use Illuminate\Database\Seeder;
|
||||
@@ -117,4 +116,4 @@ class OrderSeeder extends Seeder
|
||||
default => 1,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,4 +36,4 @@ class ProductStocksSeeder extends Seeder
|
||||
");
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user