W3cubDocs

/Laravel 5.2

Builder

class Builder (View source)

Methods

void __construct( Connection $connection)

Create a new database Schema manager.

bool hasTable( string $table)

Determine if the given table exists.

bool hasColumn( string $table, string $column)

Determine if the given table has a given column.

bool hasColumns( string $table, array $columns)

Determine if the given table has given columns.

string getColumnType( string $table, string $column)

Get the data type for the given column name.

array getColumnListing( string $table)

Get the column listing for a given table.

Blueprint table( string $table, Closure $callback)

Modify a table on the schema.

Blueprint create( string $table, Closure $callback)

Create a new table on the schema.

Blueprint drop( string $table)

Drop a table from the schema.

Blueprint dropIfExists( string $table)

Drop a table from the schema if it exists.

Blueprint rename( string $from, string $to)

Rename a table on the schema.

bool enableForeignKeyConstraints()

Enable foreign key constraints.

bool disableForeignKeyConstraints()

Disable foreign key constraints.

Connection getConnection()

Get the database connection instance.

$this setConnection( Connection $connection)

Set the database connection instance.

void blueprintResolver( Closure $resolver)

Set the Schema Blueprint resolver callback.

Details

void __construct( Connection $connection)

Create a new database Schema manager.

Parameters

Connection $connection

Return Value

void

bool hasTable( string $table)

Determine if the given table exists.

Parameters

string $table

Return Value

bool

bool hasColumn( string $table, string $column)

Determine if the given table has a given column.

Parameters

string $table
string $column

Return Value

bool

bool hasColumns( string $table, array $columns)

Determine if the given table has given columns.

Parameters

string $table
array $columns

Return Value

bool

string getColumnType( string $table, string $column)

Get the data type for the given column name.

Parameters

string $table
string $column

Return Value

string

array getColumnListing( string $table)

Get the column listing for a given table.

Parameters

string $table

Return Value

array

Blueprint table( string $table, Closure $callback)

Modify a table on the schema.

Parameters

string $table
Closure $callback

Return Value

Blueprint

Blueprint create( string $table, Closure $callback)

Create a new table on the schema.

Parameters

string $table
Closure $callback

Return Value

Blueprint

Blueprint drop( string $table)

Drop a table from the schema.

Parameters

string $table

Return Value

Blueprint

Blueprint dropIfExists( string $table)

Drop a table from the schema if it exists.

Parameters

string $table

Return Value

Blueprint

Blueprint rename( string $from, string $to)

Rename a table on the schema.

Parameters

string $from
string $to

Return Value

Blueprint

bool enableForeignKeyConstraints()

Enable foreign key constraints.

Return Value

bool

bool disableForeignKeyConstraints()

Disable foreign key constraints.

Return Value

bool

Connection getConnection()

Get the database connection instance.

Return Value

Connection

$this setConnection( Connection $connection)

Set the database connection instance.

Parameters

Connection $connection

Return Value

$this

void blueprintResolver( Closure $resolver)

Set the Schema Blueprint resolver callback.

Parameters

Closure $resolver

Return Value

void

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.2/Illuminate/Database/Schema/Builder.html