Schema::hasColumns PHP Method

hasColumns() public static method

Determine if the given table has given columns.
public static hasColumns ( string $table, array $columns ) : boolean
$table string
$columns array
return boolean
        public static function hasColumns($table, $columns)
        {
            //Method inherited from \Illuminate\Database\Schema\Builder
            return \Illuminate\Database\Schema\MySqlBuilder::hasColumns($table, $columns);
        }

Usage Example

 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     if (Schema::hasTable('hlogeon_scms_types')) {
         if (Schema::hasColumns('hlogeon_scms_types', ['list_layout_id', 'enable_own_sidebar'])) {
             Schema::table('hlogeon_scms_types', function (Blueprint $table) {
                 $table->dropColumn('list_layout_id');
                 $table->dropColumn('type_layout_id');
                 $table->dropColumn('enable_own_sidebar');
                 $table->string('type_layout');
             });
         }
     }
 }
All Usage Examples Of Schema::hasColumns