我添加的列出现在created_at和其他列之后。 我使用自定义方法通过 CRM 创建列,这就是我像这样手动添加列的原因。
public function addColumnTable($table_name,$field_name,$field_type){
Schema::table($table_name, function (Blueprint $table) use($field_name,$field_type) {
$table->{$field_type}($field_name);
});
}
我必须使用它:
public function addColumnTable($table_name,$field_name,$field_type){
Schema::table($table_name, function (Blueprint $table) use($field_name,$field_type) {
$table->{$field_type}($field_name)->after('id');
});
}