AI写作智能体 自主规划任务,支持联网查询和网页读取,多模态高效创作各类分析报告、商业计划、营销方案、教学内容等。 广告
有时候您需要修改一个存在的字段,例如:您可能想增加保存文本字段的长度。通过 change 方法让这件事情变得非常容易!假设我们想要将字段 name 的长度从 25 增加到 50 的时候: ~~~ ~~~ Schema::table('users', function($table) { $table->string('name', 50)->change(); }); ~~~ ~~~ 另外也能将某个字段修改为允许 NULL: ~~~ ~~~ Schema::table('users', function($table) { $table->string('name', 50)->nullable()->change(); }); ~~~ ~~~