了解到通过Laravel-Modules扩展包可以将应用划分多个模块,就试着安装了一下。
Laravel-Modules扩展包官方文档:https://nwidart.com/laravel-modules/v2/introduction
参考链接:http://laravelacademy.org/post/7924.html
在安装完后,到执行 composer dump-autoload 时一直报:
Class 'Modules\Monitor\Providers\***ServiceProvider' not found
网上各种查找后,有个方法解决了问题,原文如下:
Try issuing a "composer dumpautoload -o" and see if that helps, i just noticed by accident
that i saw this monolog sitting in my vendor/composer/autoload_psr4.php, maybe it helps.
原文链接:https://laravel.io/forum/02-18-2014-class-monologlogger-not-found
然后执行 composer dumpautoload -o 解决了问题。