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:
@@ -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