Builder
class Builder (View source)
Properties
protected Connection | $connection | The database connection instance. | |
protected Grammar | $grammar | The schema grammar instance. | |
protected Closure | $resolver | The Blueprint resolver callback. | |
static int | $defaultStringLength | The default string length for migrations. |
Methods
Set the default string length for migrations.
Determine if the given table exists.
Determine if the given table has a given column.
Determine if the given table has given columns.
Get the data type for the given column name.
Get the column listing for a given table.
Drop a table from the schema.
Drop a table from the schema if it exists.
Drop all tables from the database.
Drop all views from the database.
Rename a table on the schema.
Enable foreign key constraints.
Disable foreign key constraints.
Get the database connection instance.
Details
at line 45
void
__construct(Connection $connection)
Create a new database Schema manager.
at line 57
static void
defaultStringLength(int $length)
Set the default string length for migrations.
at line 68
bool
hasTable(string $table)
Determine if the given table exists.
at line 84
bool
hasColumn(string $table, string $column)
Determine if the given table has a given column.
at line 98
bool
hasColumns(string $table, array $columns)
Determine if the given table has given columns.
at line 118
string
getColumnType(string $table, string $column)
Get the data type for the given column name.
at line 131
array
getColumnListing(string $table)
Get the column listing for a given table.
at line 174
void
drop(string $table)
Drop a table from the schema.
at line 187
void
dropIfExists(string $table)
Drop a table from the schema if it exists.
at line 201
void
dropAllTables()
Drop all tables from the database.
at line 213
void
dropAllViews()
Drop all views from the database.
at line 225
void
rename(string $from, string $to)
Rename a table on the schema.
at line 237
bool
enableForeignKeyConstraints()
Enable foreign key constraints.
at line 249
bool
disableForeignKeyConstraints()
Disable foreign key constraints.
at line 262
protected void
build(Blueprint $blueprint)
Execute the blueprint to build / modify the table.
at line 274
protected Blueprint
createBlueprint(string $table, Closure $callback = null)
Create a new command set with a Closure.
at line 292
Connection
getConnection()
Get the database connection instance.
at line 303
$this
setConnection(Connection $connection)
Set the database connection instance.