seedStarterKit(); } /** * Starter kit data */ public function seedStarterKit(): void { $this->seedRoles(); collect([ [ 'first_name' => 'Nurmuhammet', 'last_name' => 'Allanov', 'email' => 'nurmuhammet@mail.com', 'password' => bcrypt('payload10'), ], ])->each(function ($data) { $user = User::create($data); $user->assignRole('admin'); }); $this->createChannels(); } public function seedRoles(): void { $roles = [ [ 'id' => 1, 'name' => 'admin', 'guard_name' => 'web', ], [ 'id' => 2, 'name' => 'manager', 'guard_name' => 'web', ], [ 'id' => 3, 'name' => 'user', 'guard_name' => 'web', ], [ 'id' => 4, 'name' => 'vendor', 'guard_name' => 'web', ], [ 'id' => 5, 'name' => 'viewer', 'guard_name' => 'web', ], ]; foreach ($roles as $role) { Role::forceCreate($role); } DB::statement(" SELECT setval('roles_id_seq', (SELECT MAX(id) from roles)) "); } public function createChannels(): void { collect([ [ 'name' => 'Tmpost', 'slug' => 'tmpost', 'description' => 'Tmpost default', 'timezone' => 'Asia/Ashgabat', 'url' => 'http://shop.post.tm', 'is_default' => true, ], ])->each(fn ($data) => Channel::create($data)); DB::statement(" SELECT setval('channels_id_seq', (SELECT MAX(id) from channels)) "); } }