*/ protected $fillable = [ 'username', 'matrix_username', 'phone', ]; public static function validateWithMatrixUsername(string $matrixUsername) { $matrixUsername = $matrixUsername ?? ''; if($matrixUsername == '') return [ 'error' => 'The username is empty, please, write username!!!' ]; $user = User::where('matrix_username', $matrixUsername)->first(); if(!$user) return [ 'error' => 'A user with the username does not exist!!!' ]; return [ 'ok' => 'A user with the username is valid.' ]; } }