问题
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