Properties

$name

$name : string

The database table name.

Type

string

Tags

None found

$connection

$connection : string

The database connection that should be used.

Type

string

Tags

None found

$engine

$engine : string

The engine that should be used for the table.

Type

string

Tags

None found

$columns

$columns : array

The columns that should be added to the table.

Type

array

Tags

None found

$commands

$commands : array

The commands that should be executed on the table.

Type

array

Tags

None found

$macros

$macros : array

The registered custom macros.

Type

array

Tags

None found

Methods

macro()

macro(string  $name, \Laravel\Database\Schema\Closure  $macro) : void

Registers a custom macro.

Parameters

string $name
LaravelDatabaseSchemaClosure $macro

static

Tags

None found

__construct()

__construct(string  $name) : void

Create a new schema table instance.

Parameters

string $name

Tags

None found

create()

create() : \Laravel\Fluent

Indicate that the table should be created.

Returns

LaravelFluent

Tags

None found

primary()

primary(string|array  $columns, string  $name = null) : \Laravel\Fluent

Create a new primary key on the table.

Parameters

string|array $columns
string $name

Returns

LaravelFluent

Tags

None found

unique()

unique(string|array  $columns, string  $name = null) : \Laravel\Fluent

Create a new unique index on the table.

Parameters

string|array $columns
string $name

Returns

LaravelFluent

Tags

None found

fulltext()

fulltext(string|array  $columns, string  $name = null) : \Laravel\Fluent

Create a new full-text index on the table.

Parameters

string|array $columns
string $name

Returns

LaravelFluent

Tags

None found

index()

index(string|array  $columns, string  $name = null) : \Laravel\Fluent

Create a new index on the table.

Parameters

string|array $columns
string $name

Returns

LaravelFluent

Tags

None found

foreign()

foreign(string|array  $columns, string  $name = null) : \Laravel\Fluent

Add a foreign key constraint to the table.

Parameters

string|array $columns
string $name

Returns

LaravelFluent

Tags

None found

key()

key(string  $type, string|array  $columns, string  $name) : \Laravel\Fluent

Create a command for creating any index.

Parameters

string $type
string|array $columns
string $name

Returns

LaravelFluent

Tags

None found

rename()

rename(string  $name) : \Laravel\Fluent

Rename the database table.

Parameters

string $name

Returns

LaravelFluent

Tags

None found

drop()

drop() : \Laravel\Fluent

Drop the database table.

Returns

LaravelFluent

Tags

None found

drop_column()

drop_column(string|array  $columns) : void

Drop a column from the table.

Parameters

string|array $columns

Tags

None found

drop_primary()

drop_primary(string  $name = null) : void

Drop a primary key from the table.

Parameters

string $name

Tags

None found

drop_unique()

drop_unique(string  $name) : void

Drop a unique index from the table.

Parameters

string $name

Tags

None found

drop_fulltext()

drop_fulltext(string  $name) : void

Drop a full-text index from the table.

Parameters

string $name

Tags

None found

drop_index()

drop_index(string  $name) : void

Drop an index from the table.

Parameters

string $name

Tags

None found

drop_foreign()

drop_foreign(string  $name) : void

Drop a foreign key constraint from the table.

Parameters

string $name

Tags

None found

increments()

increments(string  $name) : \Laravel\Fluent

Add an auto-incrementing integer to the table.

Parameters

string $name

Returns

LaravelFluent

Tags

None found

string()

string(string  $name, integer  $length = 200) : \Laravel\Fluent

Add a string column to the table.

Parameters

string $name
integer $length

Returns

LaravelFluent

Tags

None found

integer()

integer(string  $name, boolean  $increment = false) : \Laravel\Fluent

Add an integer column to the table.

Parameters

string $name
boolean $increment

Returns

LaravelFluent

Tags

None found

float()

float(string  $name) : \Laravel\Fluent

Add a float column to the table.

Parameters

string $name

Returns

LaravelFluent

Tags

None found

decimal()

decimal(string  $name, integer  $precision, integer  $scale) : \Laravel\Fluent

Add a decimal column to the table.

Parameters

string $name
integer $precision
integer $scale

Returns

LaravelFluent

Tags

None found

boolean()

boolean(string  $name) : \Laravel\Fluent

Add a boolean column to the table.

Parameters

string $name

Returns

LaravelFluent

Tags

None found

timestamps()

timestamps() : void

Create date-time columns for creation and update timestamps.

Tags

None found

date()

date(string  $name) : \Laravel\Fluent

Add a date-time column to the table.

Parameters

string $name

Returns

LaravelFluent

Tags

None found

timestamp()

timestamp(string  $name) : \Laravel\Fluent

Add a timestamp column to the table.

Parameters

string $name

Returns

LaravelFluent

Tags

None found

text()

text(string  $name) : \Laravel\Fluent

Add a text column to the table.

Parameters

string $name

Returns

LaravelFluent

Tags

None found

blob()

blob(string  $name) : \Laravel\Fluent

Add a blob column to the table.

Parameters

string $name

Returns

LaravelFluent

Tags

None found

on()

on(string  $connection) : void

Set the database connection for the table operation.

Parameters

string $connection

Tags

None found

creating()

creating() : boolean

Determine if the schema table has a creation command.

Returns

boolean

Tags

None found

__call()

__call(string  $method, array  $parameters) : mixed

Dynamically handle calls to custom macros.

Parameters

string $method
array $parameters

Returns

mixed

Tags

None found

drop_key()

drop_key(string  $type, string  $name) : \Laravel\Fluent

Create a command to drop any type of index.

Parameters

string $type
string $name

Returns

LaravelFluent

Tags

None found

command()

command(string  $type, array  $parameters = array()) : \Laravel\Fluent

Create a new fluent command instance.

Parameters

string $type
array $parameters

Returns

LaravelFluent

Tags

None found

column()

column(string  $type, array  $parameters = array()) : \Laravel\Fluent

Create a new fluent column instance.

Parameters

string $type
array $parameters

Returns

LaravelFluent

Tags

None found