How do I create Events/Listeners with artisan command at sub-directory level?

时光总嘲笑我的痴心妄想 提交于 2020-12-15 09:17:11

问题


So, I am fairly new to Laravel and working on huge laravel project. I need a way by which I can create Events and Listeners folders in my subdirectory with php artisan event:generate command or php artisan make:event and php artisan make:listener commands.

I have tried running these commands but it creates Events and Listeners in root directory under app/Events and app/Listeners.

We have a different directory structure where apart from the app we have src/directory1/directroy2/directroy3. And under directory3 we have Http controllers, Models, Providers, etc.

I would like my new Events and Listeners to be created under directory3 using artisan command.

Also, if I don't use artisan commands and create Events and Listeners folder manually, will it work? I know commands should be preferable methods for developers but what if I want to do manually?

I tried following other threads mentioned in the comment section. It didn't help.

I did php artisan make:event src/directory1/directory2. What happened is I got src/directory1/directory2 under the Events folder in the app directory. What I want is I have an src directory at the same level where the app is. I want to do something under src/directory1/directory2/directory3 directory structure. You can remove your flag as it didn't help

来源:https://stackoverflow.com/questions/58202475/how-do-i-create-events-listeners-with-artisan-command-at-sub-directory-level

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!