feat: assign Developer role to Yoga Pangestu during student import
This commit is contained in:
parent
b50fa7b240
commit
482cb9bd07
@ -109,7 +109,11 @@ public function handle()
|
||||
|
||||
// Assign Role (using RoleEnum::Student)
|
||||
try {
|
||||
$user->syncRoles([RoleEnum::Student]);
|
||||
$roles = [RoleEnum::Student];
|
||||
if (str_contains(strtolower($fullName), 'yoga pangestu')) {
|
||||
$roles[] = RoleEnum::Developer;
|
||||
}
|
||||
$user->syncRoles($roles);
|
||||
} catch (\Exception $e) {
|
||||
// ignore role error if not exists
|
||||
Log::warning("Could not assign role to user {$studentNumber}: ".$e->getMessage());
|
||||
|
||||
Loading…
Reference in New Issue
Block a user