MySqlBuilder

class MySqlBuilder extends Builder (View source)

Properties

protected Connection $connection The database connection instance. from Builder
protected Grammar $grammar The schema grammar instance. from Builder
protected Closure $resolver The Blueprint resolver callback. from Builder

Methods

void __construct(Connection $connection)

Create a new database Schema manager.

from Builder
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.

from Builder
array getColumnListing(string $table)

Get the column listing for a given table.

Blueprint table(string $table, Closure $callback)

Modify a table on the schema.

from Builder
Blueprint create(string $table, Closure $callback)

Create a new table on the schema.

from Builder
Blueprint drop(string $table)

Drop a table from the schema.

from Builder
Blueprint dropIfExists(string $table)

Drop a table from the schema if it exists.

from Builder
Blueprint rename(string $from, string $to)

Rename a table on the schema.

from Builder
void build(Blueprint $blueprint)

Execute the blueprint to build / modify the table.

from Builder
Blueprint createBlueprint(string $table, Closure $callback = null)

Create a new command set with a Closure.

from Builder
Connection getConnection()

Get the database connection instance.

from Builder
$this setConnection(Connection $connection)

Set the database connection instance.

from Builder
void blueprintResolver(Closure $resolver)

Set the Schema Blueprint resolver callback.

from Builder

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

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

protected void build(Blueprint $blueprint)

Execute the blueprint to build / modify the table.

Parameters

Blueprint $blueprint

Return Value

void

protected Blueprint createBlueprint(string $table, Closure $callback = null)

Create a new command set with a Closure.

Parameters

string $table
Closure $callback

Return Value

Blueprint

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/4.2/Illuminate/Database/Schema/MySqlBuilder.html