Answers for "laravel migration if table has column than drop\"

PHP
1

drop column table in migration if exist in laravel

Schema::table('users', function (Blueprint $table) {
     if (Schema::hasColumn('users', 'phone')) {
              $table->dropColumn('phone');
		}
});
Posted by: Guest on August-04-2021

Code answers related to "laravel migration if table has column than drop\"

Browse Popular Code Answers by Language