class MySqlBuilder extends Builder

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
static int $defaultStringLength

The default string length for migrations.

from  Builder

Methods

void
__construct(Connection $connection)

Create a new database Schema manager.

from  Builder
static void
defaultStringLength(int $length)

Set the default string length for migrations.

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
bool
hasColumns(string $table, array $columns)

Determine if the given table has given columns.

from  Builder
string
getColumnType(string $table, string $column)

Get the data type for the given column name.

from  Builder
array
getColumnListing(string $table)

Get the column listing for a given table.

void
table(string $table, Closure $callback)

Modify a table on the schema.

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

Create a new table on the schema.

from  Builder
void
drop(string $table)

Drop a table from the schema.

from  Builder
void
dropIfExists(string $table)

Drop a table from the schema if it exists.

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

Rename a table on the schema.

from  Builder
bool
enableForeignKeyConstraints()

Enable foreign key constraints.

from  Builder
bool
disableForeignKeyConstraints()

Disable foreign key constraints.

from  Builder
void
build(Blueprint $blueprint)

Execute the blueprint to build / modify the table.

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

Create a new command set with a Closure.

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

in Builder at line 44
void __construct(Connection $connection)

Create a new database Schema manager.

Parameters

Connection $connection

Return Value

void

in Builder at line 56
static void defaultStringLength(int $length)

Set the default string length for migrations.

Parameters

int $length

Return Value

void

at line 13
bool hasTable(string $table)

Determine if the given table exists.

Parameters

string $table

Return Value

bool

in Builder at line 83
bool hasColumn(string $table, string $column)

Determine if the given table has a given column.

Parameters

string $table
string $column

Return Value

bool

in Builder at line 97
bool hasColumns(string $table, array $columns)

Determine if the given table has given columns.

Parameters

string $table
array $columns

Return Value

bool

in Builder at line 117
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 28
array getColumnListing(string $table)

Get the column listing for a given table.

Parameters

string $table

Return Value

array

in Builder at line 146
void table(string $table, Closure $callback)

Modify a table on the schema.

Parameters

string $table
Closure $callback

Return Value

void

in Builder at line 158
void create(string $table, Closure $callback)

Create a new table on the schema.

Parameters

string $table
Closure $callback

Return Value

void

in Builder at line 173
void drop(string $table)

Drop a table from the schema.

Parameters

string $table

Return Value

void

in Builder at line 186
void dropIfExists(string $table)

Drop a table from the schema if it exists.

Parameters

string $table

Return Value

void

in Builder at line 200
void rename(string $from, string $to)

Rename a table on the schema.

Parameters

string $from
string $to

Return Value

void

in Builder at line 212
bool enableForeignKeyConstraints()

Enable foreign key constraints.

Return Value

bool

in Builder at line 224
bool disableForeignKeyConstraints()

Disable foreign key constraints.

Return Value

bool

in Builder at line 237
protected void build(Blueprint $blueprint)

Execute the blueprint to build / modify the table.

Parameters

Blueprint $blueprint

Return Value

void

in Builder at line 249
protected Blueprint createBlueprint(string $table, Closure $callback = null)

Create a new command set with a Closure.

Parameters

string $table
Closure $callback

Return Value

Blueprint

in Builder at line 263
Connection getConnection()

Get the database connection instance.

Return Value

Connection

in Builder at line 274
$this setConnection(Connection $connection)

Set the database connection instance.

Parameters

Connection $connection

Return Value

$this

in Builder at line 287
void blueprintResolver(Closure $resolver)

Set the Schema Blueprint resolver callback.

Parameters

Closure $resolver

Return Value

void