-
-
Notifications
You must be signed in to change notification settings - Fork 802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature]: add mechanism for adding our own dynamic variables to be used in customized templates #356
Comments
@vesper8 currently, there is no way to do this, I will take it in a queue and will add a support for it. |
This would be good idea. Any update on this? |
There is no update on this. We will think to add it soon. |
Just added support for this in the latest version v5.3.0. You can add dynamic variables to the generator config by calling Add the following code in the
Alternatively, you can add multiple variables as well by,
Once variables are added, you can publish templates and then modify the view file to use the variable,
As per the new release, Let me know if any further explanations or suggestions are there. |
In GeneratorConfig.php at the bottom of the loadDynamicVariables function you have this
This is a useful way of adding new dynamic variables. I have added a few of them myself that I use in my customized stubs.
However this forces me to make edits inside of the /vendor folder which is bad practice.
Would it be possible to add an array "dynamic_variables" inside of laravel_generator.php and iterate through it in GeneratorConfig.php so that we could add our own dynamic variables via the configuration file?
Please and thank you :)
The text was updated successfully, but these errors were encountered: