how to make migration in laravel to drop column if exist code example
Example 1: laravel drop column if exists
if (Schema::hasColumn('users', 'phone')) {
Schema::table('users', function (Blueprint $table){
$table->dropColumn('phone');
});
}
Example 2: laravel drop column if exists
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('name');
});