Skip to content

Commit 7830ba2

Browse files
committed
Update UsersController.php
1 parent 8bd40b4 commit 7830ba2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/Http/Controllers/UsersController.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,11 @@ public function checkUsernameAvailability()
132132

133133
$available = $errors->isEmpty();
134134
$message = $available ? "Username '".e($username)."' is available!" : $errors->toSentence();
135-
$cost = $available ? Auth::user()->usernameChangeCost() : 0;
135+
$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+
}
136140

137141
return [
138142
'username' => Request::input('username'),

0 commit comments

Comments
 (0)