【laravel5.6】 Laravel 数据迁移给表和字段添加注释

1 引用DB

use IlluminateSupportFacadesDB;

2 up方法

public function up()
    {
        Schema::create('code_table', function (Blueprint $table) {
            $table->integer('id')->unsigned()->primary()->comment('这是字段注释');
            
           
        });
        DB::statement("ALTER TABLE `code_table` comment '这是表注释'");
    }
原文地址:https://www.cnblogs.com/richerdyoung/p/10045815.html