@@ -148,30 +148,10 @@ private function generateTableHeaderFields(): string
148
148
continue ;
149
149
}
150
150
151
- if ($ this ->config ->options ->localized ) {
152
- /**
153
- * Replacing $FIELD_NAME$ before fill_template_with_field_data_locale() otherwise also
154
- * $FIELD_NAME$ get replaced with @lang('models/$modelName.fields.$value')
155
- * and so we don't have $FIELD_NAME$ in table_header_locale.stub
156
- * We could need 'raw' field name in header for example for sorting.
157
- * We still have $FIELD_NAME_TITLE$ replaced with @lang('models/$modelName.fields.$value').
158
- *
159
- * @see issue https://github.com/InfyOmLabs/laravel-generator/issues/887
160
- */
161
- $ preFilledHeaderFieldTemplate = str_replace ('$FIELD_NAME$ ' , $ field ->name , '' );
162
-
163
- $ headerFields [] = fill_template_with_field_data_locale (
164
- $ this ->config ->dynamicVars ,
165
- ['$FIELD_NAME_TITLE$ ' => 'fieldTitle ' , '$FIELD_NAME$ ' => 'name ' ],
166
- $ preFilledHeaderFieldTemplate ,
167
- $ field
168
- );
169
- } else {
170
- $ headerFields [] = view (
171
- $ this ->templateType .'::templates.scaffold.table.blade.header ' ,
172
- $ field ->variables ()
173
- )->render ();
174
- }
151
+ $ headerFields [] = view (
152
+ $ this ->templateType .'::templates.scaffold.table.blade.header ' ,
153
+ $ field ->variables ()
154
+ )->render ();
175
155
}
176
156
177
157
return implode (infy_nl_tab (1 , 4 ), $ headerFields );
@@ -210,27 +190,6 @@ private function generateFields()
210
190
continue ;
211
191
}
212
192
213
- $ validations = explode ('| ' , $ field ->validations );
214
- $ minMaxRules = '' ;
215
- foreach ($ validations as $ validation ) {
216
- if (!Str::contains ($ validation , ['max: ' , 'min: ' ])) {
217
- continue ;
218
- }
219
-
220
- $ validationText = substr ($ validation , 0 , 3 );
221
- $ sizeInNumber = substr ($ validation , 4 );
222
-
223
- $ sizeText = ($ validationText == 'min ' ) ? 'minlength ' : 'maxlength ' ;
224
- if ($ field ->htmlType == 'number ' ) {
225
- $ sizeText = $ validationText ;
226
- }
227
-
228
- $ size = ",' $ sizeText' => $ sizeInNumber " ;
229
- $ minMaxRules .= $ size ;
230
- }
231
- // TODO:
232
- // $this->config->addDynamicVariable('$SIZE$', $minMaxRules);
233
-
234
193
$ htmlFields [] = HTMLFieldGenerator::generateHTML (
235
194
$ field ,
236
195
$ this ->templateViewPath
0 commit comments