@@ -110,13 +110,13 @@ protected function getRawIndexes()
110110 {
111111 $ result = DB ::select (
112112 '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; ' ,
120120 [$ this ->tableName , $ this ->databaseName ]
121121 );
122122
@@ -247,6 +247,9 @@ protected function getTransfredFields(array $columns)
247247 $ collection = [];
248248
249249 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
250253 $ properties ['name ' ] = $ column ->COLUMN_NAME ;
251254 $ properties ['is-nullable ' ] = ($ column ->IS_NULLABLE == 'YES ' );
252255 $ properties ['data-value ' ] = $ column ->COLUMN_DEFAULT ;
@@ -262,7 +265,7 @@ protected function getTransfredFields(array $columns)
262265
263266 $ constraint = $ this ->getForeignConstraint ($ column ->COLUMN_NAME );
264267
265- $ properties ['foreign-constraint ' ] = is_null ($ constraint ) ? null : $ constraint ->toArray ();
268+ $ properties ['foreign-constraint ' ] = ! is_null ($ constraint ) ? $ constraint ->toArray () : null ;
266269
267270 if (intval ($ column ->CHARACTER_MAXIMUM_LENGTH ) > 255
268271 || in_array ($ column ->DATA_TYPE , $ this ->largeDataTypes )) {
@@ -273,6 +276,9 @@ protected function getTransfredFields(array $columns)
273276 }
274277 $ localeGroup = Helpers::makeLocaleGroup ($ this ->tableName );
275278 $ 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
276282 $ this ->setHtmlType ($ fields );
277283
278284 return $ fields ;
0 commit comments