<human>:  Why did John Gay write The Beggar’s Opera?
<bot>: John Gay wrote The Beggar’s Opera to protest against the repressive laws of the time. The play was a satire of the repressive laws of the time, and was a huge success.