在 laravel-5.8 和 maatwebsite/excel 中找不到错误“Class 'ZipArchive'”

Error 'Class 'ZipArchive' not found' in laravel-5.8 with maatwebsite/excel

错误 Class 'ZipArchive' not found maatwebsite/excel 导出 table 用户 laravel。
我已经尝试过 sudo apt-get install php7.0-zip,但结果是 sudo: apt-get: command not found。那么除了sudo apt-get install php7.0-zip还有其他方法可以解决吗?或者如何解决 sudo: apt-get: command not found 问题?

您 php 似乎没有内置 zip 扩展名。尝试按照以下步骤安装带有扩展名的版本:

brew update
brew install php@7.3
brew link php@7.3