Open Peterragheb opened 3 months ago
Sure, PR welcome. In general, I didn't go with the approach of using the Laravel container because I wanted it to be easily testable in isolation.
@shalvah here's the PR https://github.com/knuckleswtf/scribe/pull/822
Btw I think the localization can be improved a bit.
let me know if you're okay with that and I'll work on a PR
If you can make it work while still making sense for the end user and not having too much maintenance overhead, sure 👍
Scribe version
4.29.0
Your question
I'm wondering it's possible to do some code refactoring to allow easier customization
for example in the
GenerateDocumentation
command you instantiate theWriter
class using the new keyword. Why not use the service container to instantiate it this way it would be easier to custom bind it. (of course there's a lot of other options like adding it to the config file but I think the container is the fastest and easiest solution)Same for instantiating the
CustomTranslationsLoader
in theScribeServiceProvider
.Btw these are the classes I had to customize in order to get the localization to work the way I want it to. This includes:
scribe.php
lang file under the correct locale directory (Had to customizeCustomTranslationsLoader
)resources/views/scribe/en/index.blade.php
(Had to customize theWriter
)Docs