argument('role'); $role = Roles::tryFrom($roleToAdd); if($role === null) { $this->error('Could not find role "'.$roleToAdd.'".'); return; } $userId = $this->argument('user'); if(Str::contains($userId, '-')) $user = User::find($userId); else $user = User::findBySteamID($userId); if ($user === null) { $this->error('User id "' . $userId . '" not found'); return; } if($user->hasRole($role)){ $this->warn('User "'.$user->id.'" already has role "'.$roleToAdd.'"'); return; } $user->assignRole($role); $this->info('User "'.$user->id.'" now has the role "'.$roleToAdd.'"'); } }