Answers for "remove column using wheredoesnot have in laravel"

PHP
3

laravel drop column if exists

if (Schema::hasColumn('users', 'phone')) {
 	Schema::table('users', function (Blueprint $table){
       $table->dropColumn('phone');
    });
}
Posted by: Guest on November-13-2020
0

laravel drop column softdeletes

public function down()
{
  Schema::table('users', function (Blueprint $table) {
    $table->dropSoftDeletes();
  });
}
Posted by: Guest on September-04-2020

Code answers related to "remove column using wheredoesnot have in laravel"

Browse Popular Code Answers by Language