Customizing Generators
Opened this issue · 2 comments
Dear @OzanKurt
sorry for spamming issues here, but i thought it would be best to have different issues and not everything in one place ;) Makes it much more easy to answer and - for other users - to follow and search for related issues / terms..
So here is another question:
I would like to customize the existing generators. Specifically, i am not very happy with the folders and namespaces used. I know, they can be customized in the config file but does not allow for placeholders. In my current application, i changed the "typical laravel application structure" to a more "modular structure". More specifically, i build everything around "modules", which encapsulate everything around one main model. Consider, for example, the typical User > Post > Comment
application. The structure would look like this:
app/Modules
/Authentication
/Comments
/Posts
/Users
More specifically, the User
module, could look like this:
app/Modules/User
/Contracts
/Repositories --> the repository interfaces
/Data
/Migrations --> the migration files for this module
/Factories --> the factory classes for this module
/Repositories --> the repository classes for this model
/Models --> the user model and other models that may be important for this module
/UI
/Api --> everything related to the api
/Controllers
/Requests
/Routes
/Transformers
/Web
/...
/Tests
/Traits
Is it possible to use the defined generators with this folder structure? Furthermore, i don't really like that the EloquentXXXRepository
has Eloquent
in its name - and would therefore like to remove it.. This would, most likely, result in re-writing the generators of your package, right?
All the best and thanks a lot for your time and effort!
This should be possible as long as a user specifies the pathing in the config for sure, I will check this soon. (Probably in 10 days or so)
Thanks a lot for your effort!