Update DatabaseSeeder to include all seeders and add inventory creation in UsersTableSeeder
- Enabled all previously commented-out seeders in DatabaseSeeder for comprehensive data seeding. - Added inventory creation logic in UsersTableSeeder to initialize a new inventory record for 'Tmpost'.
This commit is contained in:
@@ -33,25 +33,25 @@ class DatabaseSeeder extends Seeder
|
||||
public function run(): void
|
||||
{
|
||||
$this->call([
|
||||
// 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,
|
||||
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,
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\Ecommerce\Channel\Channel;
|
||||
use App\Models\Ecommerce\Product\Inventory\Inventory;
|
||||
use App\Models\System\Roles\Role;
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Seeder;
|
||||
@@ -96,5 +97,14 @@ class UsersTableSeeder extends Seeder
|
||||
DB::statement("
|
||||
SELECT setval('channels_id_seq', (SELECT MAX(id) from channels))
|
||||
");
|
||||
|
||||
Inventory::create([
|
||||
'id' => 14,
|
||||
'code' => 'tmpost',
|
||||
'name' => 'Tmpost inventory',
|
||||
'region' => 'ag',
|
||||
'phone_number' => '99361099310',
|
||||
'channel_id' => Channel::where('slug', 'tmpost')->first()->id,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user