string('path', 400); $table->string('type')->index(); }); Image::all()->each(function ($image) { $image->path = $image->url; $image->type = 'gallery'; $image->save(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('images', function (Blueprint $table) { $table->dropColumn('type'); $table->dropColumn('path'); }); } };