【laravel5.6】 Laravel 数据迁移给表和字段添加注释
1 引用DB
use Illuminate\Support\Facades\DB;
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 '这是表注释'"); }
欢迎做技术的朋友一起沟通交流!伸手党请绕道,
代码改变世界QQ群:453011886