Skip to content

Commit

Permalink
add dropColumns method on the schema class
Browse files Browse the repository at this point in the history
  • Loading branch information
imanghafoori1 committed Oct 7, 2020
1 parent 17e467c commit fc600c4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
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 ($table, $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

0 comments on commit fc600c4

Please sign in to comment.