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');
		}
});
 
PREVIOUS NEXT
Tagged: #drop #column #table #migration #exist #laravel
ADD COMMENT
Topic
Name
9+3 =