src/Migration.php
protected function drop($tables, bool $ignoreKeyConstraints = false) : void
    {
        if ($ignoreKeyConstraints) {
            $this->database->statement('SET FOREIGN_KEY_CHECKS=0;');
        }

        if (! is_array($tables)) {
            $tables = [$tables];
        }

        foreach ($tables as $table) {
            if ($this->tableExists($table)) {
                $this->schema->drop($table);
            }
        }

        if ($ignoreKeyConstraints) {
            $this->database->statement('SET FOREIGN_KEY_CHECKS=1;');
        }
    }
protected function drop($tables, bool $ignoreKeyConstraints = false) : void
    {
        if ($ignoreKeyConstraints) {
            $this->database->statement('SET FOREIGN_KEY_CHECKS=0;');
        }

        if (! is_array($tables)) {
            $tables = [$tables];
        }

        foreach ($tables as $table) {
            if ($this->tableExists($table)) {
                $this->schema->drop($table);
            }
        }

        if ($ignoreKeyConstraints) {
            $this->database->statement('SET FOREIGN_KEY_CHECKS=1;');
        }
    }
protected function drop ( $ tables , bool $ ignoreKeyConstraints = false ) : void { if ( $ ignoreKeyConstraints ) { $ this -> database -> statement ( 'SET FOREIGN_KEY_CHECKS=0;' ) ; } if ( ! is_array ( $ tables ) ) { $ tables = [ $ tables ] ; } foreach ( $ tables as $ table ) { if ( $ this -> tableExists ( $ table ) ) { $ this -> schema -> drop ( $ table ) ; } } if ( $ ignoreKeyConstraints ) { $ this -> database -> statement ( 'SET FOREIGN_KEY_CHECKS=1;' ) ; } }
Safely drop a table.

@param array|string $tables
@param bool $ignoreKeyConstraints

@return void
Safely drop a table .