Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.x] Add dropColumns method on the schema class #34720

Merged
merged 2 commits into from Oct 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/Illuminate/Database/Schema/Builder.php
Expand Up @@ -405,4 +405,18 @@ public function blueprintResolver(Closure $resolver)
{
$this->resolver = $resolver;
}

/**
* Drop columns from a table schema.
*
* @param string $table
* @param string|array $columns
* @return void
*/
public function dropColumns($table, $columns)
{
$this->table($table, function (Blueprint $blueprint) use ($columns) {
$blueprint->dropColumn($columns);
});
}
}
1 change: 1 addition & 0 deletions src/Illuminate/Support/Facades/Schema.php
Expand Up @@ -12,6 +12,7 @@
* @method static \Illuminate\Database\Schema\Builder table(string $table, \Closure $callback)
* @method static bool hasColumn(string $table, string $column)
* @method static bool hasColumns(string $table, array $columns)
* @method static bool dropColumns(string $table, array $columns)
* @method static bool hasTable(string $table)
* @method static void defaultStringLength(int $length)
* @method static void registerCustomDoctrineType(string $class, string $name, string $type)
Expand Down