更新时间:2023-12-01 10:14:22
基于此链接,我找到了答案: https://***.com/a/23506744/4650792
Based on this link i found the answer: https://***.com/a/23506744/4650792
Schema::table('warrant_grants',function ($table){
$table->string('name',100)->after('id')->nullable();
});
$results = DB::table('warrant_grants')->select('id','name')->get();
$i = 1;
foreach ($results as $result){
DB::table('warrant_grants')
->where('id',$result->id)
->update([
"name" => "Warrant-".$i
]);
$i++;
}
无论如何,谢谢大家的帮助.
Thanks for the help anyway guys.