create(); $admin = \App\Models\User::factory()->create([ 'name' => 'Admin User', 'email' => 'admin@gmail.com', 'employee_id' => 1, 'password' => bcrypt('password'), ]); $member = \App\Models\User::factory()->create([ 'name' => 'Member User', 'email' => 'member@gmail.com', 'employee_id' => 2, 'password' => bcrypt('password'), ]); $adminRole = Role::create(['name' => 'admin']); $memberRole = Role::create(['name' => 'member']); $permission = Permission::create(['name' => 'create leaves']); $permission = Permission::create(['name' => 'access leaves']); $permission = Permission::create(['name' => 'edit leaves']); $permission = Permission::create(['name' => 'delete leaves']); $permission = Permission::create(['name' => 'access roles']); $permission = Permission::create(['name' => 'edit roles']); $permission = Permission::create(['name' => 'create roles']); $permission = Permission::create(['name' => 'delete roles']); $permission = Permission::create(['name' => 'access users']); $permission = Permission::create(['name' => 'edit users']); $permission = Permission::create(['name' => 'create users']); $permission = Permission::create(['name' => 'delete users']); $permission = Permission::create(['name' => 'access permissions']); $permission = Permission::create(['name' => 'edit permissions']); $permission = Permission::create(['name' => 'create permissions']); $permission = Permission::create(['name' => 'delete permissions']); $admin->assignRole($adminRole); $member->assignRole($memberRole); $adminRole->givePermissionTo(Permission::all()); } }