laravel-generator
laravel-generator copied to clipboard
[Feature]: Custom Field Title
First let me introduce my thanks for your efforts. However, I'm not really sure that, if you have a way to make a custom field title for the generated stuff, and all I have found is something like this :
Str::title(str_replace('_', ' ', $field['fieldName'])
It's OK, but I think if we made this line as the default field title if there is no a custom one, then we will have the ability to let developers use their own titles -- with their own languages if they would (e.g. Arabic) -- rather than the current method. So, I suggest that we should use the current external JSON files to help developers keeping their custom fields titles there, and for each table they have in their schema. if there is no custom title(s) for one or more fields, then we could use the default approach of the generated title(s).
Yours,
@abdullaheid will consider this feature in next roadmap.
@mitulgolakiya bumping on this.... lets say in json, i added a new key with name label
and passed some value for each field and i tried to customize above one with something like this
https://github.com/InfyOmLabs/laravel-generator/blob/develop/src/Generators/Scaffold/ViewGenerator.php#L384
i have replaced Str::title(str_replace('_', ' ', $field->name)),
with Str::title($field->label),
however i am getting error saying label
doesn't exist
also when i log the fields array, i can see that label
which i added in json is not being copied.
so can you tell me, where you are parsing json file and assigning data into variables? so that i can customize it.
thanks
@gcnu1 that is handled over here: https://github.com/InfyOmLabs/laravel-generator/blob/develop/src/Common/CommandData.php#L130
From here, we are taking input, either from File or From Console Input or From Database.
But I like the idea, we can consider adding that functionality of Label