We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8bd40b4 commit 7830ba2Copy full SHA for 7830ba2
app/Http/Controllers/UsersController.php
@@ -132,7 +132,11 @@ public function checkUsernameAvailability()
132
133
$available = $errors->isEmpty();
134
$message = $available ? "Username '".e($username)."' is available!" : $errors->toSentence();
135
- $cost = $available ? Auth::user()->usernameChangeCost() : 0;
+ $isCapitalizationOnly = strcasecmp($username, Auth::user()->username) === 0 && $username !== Auth::user()->username;
136
+ $cost = 0;
137
+ if ($available) {
138
+ $cost = $isCapitalizationOnly ? 0 : Auth::user()->usernameChangeCost();
139
+ }
140
141
return [
142
'username' => Request::input('username'),
0 commit comments