Refactor the User validator.
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-08-14 20:45:57 +03:00
parent 41acdd861b
commit 6db3465407
4 changed files with 46 additions and 34 deletions
+4 -4
View File
@@ -23,16 +23,16 @@ class User extends Authenticatable
'phone',
];
public static function validate_with_matrix_username(string $matrix_username)
public static function validateWithMatrixUsername(string $matrixUsername)
{
$matrix_username = $matrix_username ?? '';
$matrixUsername = $matrixUsername ?? '';
if($matrix_username == '')
if($matrixUsername == '')
return [
'error' => 'The username is empty, please, write username!!!'
];
$user = User::where('matrix_username', $matrix_username)->first();
$user = User::where('matrix_username', $matrixUsername)->first();
if(!$user)
return [