public function attributes($table, $column)
{
$tableSchema = $table;
if (!$table instanceof Table) {
$tableSchema = $this->schema($table);
}
$validOptions = ['length', 'limit', 'default', 'null', 'precision', 'scale', 'after', 'update', 'comment', 'unsigned', 'signed', 'properties', 'autoIncrement'];
$attributes = [];
$options = $tableSchema->column($column);
foreach ($options as $_option => $value) {
$option = $_option;
switch ($_option) {
case 'length':
$option = 'limit';
break;
case 'unsigned':
$option = 'signed';
$value = (bool) (!$value);
break;
case 'unique':
$value = (bool) $value;
break;
}
if (!in_array($option, $validOptions)) {
continue;
}
$attributes[$option] = $value;
}
ksort($attributes);
return $attributes;
}