Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

drop column table in migration if exist in laravel

Schema::table('users', function (Blueprint $table) {
     if (Schema::hasColumn('users', 'phone')) {
              $table->dropColumn('phone');
		}
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #drop #column #table #migration #exist #laravel
ADD COMMENT
Topic
Name
2+6 =