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.

table( string $table, Closure $callback)

Modify a table on the schema.

create( string $table, Closure $callback)

Create a new table on the schema.

drop( string $table)

Drop a table from the schema.

dropIfExists( string $table)

Drop a table from the schema if it exists.

rename( string $from, string $to)

Rename a table on the schema.

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

at line line 37
void __construct( Connection $connection)

Create a new database Schema manager.

Parameters

Connection $connection

Return Value

void

at line line 49
bool hasTable( string $table)

Determine if the given table exists.

Parameters

string $table

Return Value

bool

at line line 65
bool hasColumn( string $table, string $column)

Determine if the given table has a given column.

Parameters

string $table
string $column

Return Value

bool

at line line 79
bool hasColumns( string $table, array $columns)

Determine if the given table has given columns.

Parameters

string $table
array $columns

Return Value

bool

at line line 99
string getColumnType( string $table, string $column)

Get the data type for the given column name.

Parameters

string $table
string $column

Return Value

string

at line line 112
array getColumnListing( string $table)

Get the column listing for a given table.

Parameters

string $table

Return Value

array

at line line 128
Blueprint table( string $table, Closure $callback)

Modify a table on the schema.

Parameters

string $table
Closure $callback

Return Value

Blueprint

at line line 140
Blueprint create( string $table, Closure $callback)

Create a new table on the schema.

Parameters

string $table
Closure $callback

Return Value

Blueprint

at line line 157
Blueprint drop( string $table)

Drop a table from the schema.

Parameters

string $table

Return Value

Blueprint

at line line 172
Blueprint dropIfExists( string $table)

Drop a table from the schema if it exists.

Parameters

string $table

Return Value

Blueprint

at line line 188
Blueprint rename( string $from, string $to)

Rename a table on the schema.

Parameters

string $from
string $to

Return Value

Blueprint

at line line 229
Connection getConnection()

Get the database connection instance.

Return Value

Connection

at line line 240
$this setConnection( Connection $connection)

Set the database connection instance.

Parameters

Connection $connection

Return Value

$this

at line line 253
void blueprintResolver( Closure $resolver)

Set the Schema Blueprint resolver callback.

Parameters

Closure $resolver

Return Value

void