This commit is contained in:
@@ -115,7 +115,7 @@ class CartController extends Controller
|
||||
$cityName = $request->input('cityName') ?? '';
|
||||
|
||||
// check for not valid user
|
||||
$validation = User::validate_with_matrix_username($matrixUsername);
|
||||
$validation = User::validateWithMatrixUsername($matrixUsername);
|
||||
if(array_key_exists('error', $validation))
|
||||
return response()->json($validation);
|
||||
|
||||
@@ -160,7 +160,7 @@ class CartController extends Controller
|
||||
$companyName = $request->input('companyName') ?? '';
|
||||
|
||||
// check for not valid user
|
||||
$validation = User::validate_with_matrix_username($matrixUsername);
|
||||
$validation = User::validateWithMatrixUsername($matrixUsername);
|
||||
if(array_key_exists('error', $validation))
|
||||
return response()->json($validation);
|
||||
|
||||
@@ -203,7 +203,7 @@ class CartController extends Controller
|
||||
$itemCount = $request->input('itemCount') ?? '';
|
||||
|
||||
// check for not valid user
|
||||
$validation = User::validate_with_matrix_username($matrixUsername);
|
||||
$validation = User::validateWithMatrixUsername($matrixUsername);
|
||||
if(array_key_exists('error', $validation))
|
||||
return response()->json($validation);
|
||||
|
||||
|
||||
+4
-4
@@ -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 [
|
||||
|
||||
Reference in New Issue
Block a user