@@ -110,13 +110,13 @@ protected function getRawIndexes()
110
110
{
111
111
$ result = DB ::select (
112
112
'SELECT
113
- INDEX_NAME AS name
114
- ,COUNT(1) AS TotalColumns
115
- ,GROUP_CONCAT(DISTINCT COLUMN_NAME ORDER BY SEQ_IN_INDEX ASC SEPARATOR \'||| \') AS columns
116
- FROM INFORMATION_SCHEMA.STATISTICS AS s
117
- WHERE TABLE_NAME = ? AND TABLE_SCHEMA = ?
118
- GROUP BY INDEX_NAME
119
- HAVING COUNT(1) > 1; ' ,
113
+ INDEX_NAME AS name
114
+ ,COUNT(1) AS TotalColumns
115
+ ,GROUP_CONCAT(DISTINCT COLUMN_NAME ORDER BY SEQ_IN_INDEX ASC SEPARATOR \'||| \') AS columns
116
+ FROM INFORMATION_SCHEMA.STATISTICS AS s
117
+ WHERE TABLE_NAME = ? AND TABLE_SCHEMA = ?
118
+ GROUP BY INDEX_NAME
119
+ HAVING COUNT(1) > 1; ' ,
120
120
[$ this ->tableName , $ this ->databaseName ]
121
121
);
122
122
@@ -247,6 +247,9 @@ protected function getTransfredFields(array $columns)
247
247
$ collection = [];
248
248
249
249
foreach ($ columns as $ column ) {
250
+ // While constructing the array for each field
251
+ // there is no need to set translations for options
252
+ // or even labels. This step is handled using the FieldTransformer
250
253
$ properties ['name ' ] = $ column ->COLUMN_NAME ;
251
254
$ properties ['is-nullable ' ] = ($ column ->IS_NULLABLE == 'YES ' );
252
255
$ properties ['data-value ' ] = $ column ->COLUMN_DEFAULT ;
@@ -262,7 +265,7 @@ protected function getTransfredFields(array $columns)
262
265
263
266
$ constraint = $ this ->getForeignConstraint ($ column ->COLUMN_NAME );
264
267
265
- $ properties ['foreign-constraint ' ] = is_null ($ constraint ) ? null : $ constraint ->toArray ();
268
+ $ properties ['foreign-constraint ' ] = ! is_null ($ constraint ) ? $ constraint ->toArray () : null ;
266
269
267
270
if (intval ($ column ->CHARACTER_MAXIMUM_LENGTH ) > 255
268
271
|| in_array ($ column ->DATA_TYPE , $ this ->largeDataTypes )) {
@@ -273,6 +276,9 @@ protected function getTransfredFields(array $columns)
273
276
}
274
277
$ localeGroup = Helpers::makeLocaleGroup ($ this ->tableName );
275
278
$ fields = FieldTransformer::fromArray ($ collection , $ localeGroup , $ this ->languages );
279
+
280
+ // At this point we constructed the fields collection with the default html-type
281
+ // We need to set the html-type using the config::getEloquentToHtmlMap() setting
276
282
$ this ->setHtmlType ($ fields );
277
283
278
284
return $ fields ;
0 commit comments