hasTable('notes')) { Capsule::schema()->table('notes', function ($table) { if (!Capsule::schema()->hasColumn('notes', 'notes_image')) { $table->string('notes_image')->nullable()->after('notes_color'); } if (!Capsule::schema()->hasColumn('notes', 'notes_file')) { $table->string('notes_file')->nullable()->after('notes_image'); } }); } } /** * Reverse the migration. * * @return void */ public function down() { if (Capsule::schema()->hasTable('notes')) { Capsule::schema()->table('notes', function ($table) { if (Capsule::schema()->hasColumn('notes', 'notes_image')) { $table->dropColumn('notes_image'); } if (Capsule::schema()->hasColumn('notes', 'notes_file')) { $table->dropColumn('notes_file'); } }); } } }