@@ -251,7 +251,7 @@ protected function getTransfredFields(array $columns)
251251 $ properties ['labels ' ] = $ this ->getLabel ($ column ->COLUMN_NAME );
252252 $ properties ['is-nullable ' ] = ($ column ->IS_NULLABLE == 'YES ' );
253253 $ properties ['data-value ' ] = $ column ->COLUMN_DEFAULT ;
254- $ properties ['data-type ' ] = $ this ->getDataType ($ column ->DATA_TYPE );
254+ $ properties ['data-type ' ] = $ this ->getDataType ($ column ->DATA_TYPE , $ column -> COLUMN_TYPE );
255255 $ properties ['data-type-params ' ] = $ this ->getPrecision ($ column ->CHARACTER_MAXIMUM_LENGTH , $ column ->DATA_TYPE , $ column ->COLUMN_TYPE );
256256 $ properties ['is-primary ' ] = ($ column ->COLUMN_KEY == 'PRIMARY KEY ' );
257257 $ properties ['is-index ' ] = ($ column ->COLUMN_KEY == 'MUL ' );
@@ -313,13 +313,18 @@ protected function getPrecision($length, $dataType, $columnType)
313313 * Gets the data type for a giving field.
314314 *
315315 * @param string $type
316+ * @param string $columnType
316317 *
317318 * @return $this
318319 */
319- protected function getDataType ($ type )
320+ protected function getDataType ($ type, $ columnType )
320321 {
321322 $ map = Config::dataTypeMap ();
322323
324+ if ($ columnType == 'tinyint(1) ' ) {
325+ return 'boolean ' ;
326+ }
327+
323328 if (!array_key_exists ($ type , $ map )) {
324329 throw new Exception ("The type " . $ type . " is not mapped in the 'eloquent_type_to_method' key in the config file. " );
325330 }
@@ -361,7 +366,7 @@ protected function getForeignConstraint($name)
361366 */
362367 protected function getHtmlOptions ($ dataType , $ columnType )
363368 {
364- if ($ dataType == 'tinyint(1) ' ) {
369+ if ($ columnType == 'tinyint(1) ' ) {
365370 return $ this ->getBooleanOptions ();
366371 }
367372
0 commit comments