Blueprint
class Blueprint (View source)
Properties
Methods
Indicate that the table needs to be temporary.
Indicate that the table should be dropped if it exists.
Indicate that the given columns should be dropped.
Indicate that the given columns should be renamed.
Indicate that the given primary key should be dropped.
Indicate that the given unique key should be dropped.
Indicate that the given foreign key should be dropped.
Indicate that the timestamp columns should be dropped.
Indicate that the timestamp columns should be dropped.
Indicate that the soft delete column should be dropped.
Indicate that the remember token column should be dropped.
Specify the primary key(s) for the table.
Create a new auto-incrementing integer (4-byte) column on the table.
Create a new auto-incrementing small integer (2-byte) column on the table.
Create a new auto-incrementing medium integer (3-byte) column on the table.
Create a new auto-incrementing big integer (8-byte) column on the table.
Create a new medium text column on the table.
Create a new integer (4-byte) column on the table.
Create a new tiny integer (1-byte) column on the table.
Create a new small integer (2-byte) column on the table.
Create a new medium integer (3-byte) column on the table.
Create a new big integer (8-byte) column on the table.
Create a new unsigned tiny integer (1-byte) column on the table.
Create a new unsigned small integer (2-byte) column on the table.
Create a new unsigned medium integer (3-byte) column on the table.
Create a new unsigned integer (4-byte) column on the table.
Create a new unsigned big integer (8-byte) column on the table.
Create a new float column on the table.
Create a new double column on the table.
Create a new decimal column on the table.
Create a new date-time column (with time zone) on the table.
Create a new timestamp (with time zone) column on the table.
Add nullable creation and update timestamps to the table.
Add nullable creation and update timestamps to the table.
Add creation and update timestampTz columns to the table.
Add a "deleted at" timestamp for the table.
Create a new MAC address column on the table.
Add the proper columns for a polymorphic table.
Adds the remember_token
column to the table.
Add a new column to the blueprint.
Remove a column from the schema blueprint.
Get the table the blueprint describes.
Get the columns on the blueprint.
Get the commands on the blueprint.
Get the columns on the blueprint that should be added.
Get the columns on the blueprint that should be changed.
Details
at line line 64
void
__construct(
string $table,
Closure $callback = null)
Create a new schema blueprint.
at line line 80
void
build(
Connection $connection,
Grammar $grammar)
Execute the blueprint against the database.
at line line 94
array
toSql(
Connection $connection,
Grammar $grammar)
Get the raw SQL statements for the blueprint.
at line line 226
Fluent
dropColumn(
array|mixed $columns)
Indicate that the given columns should be dropped.
at line line 240
Fluent
renameColumn(
string $from,
string $to)
Indicate that the given columns should be renamed.
at line line 251
Fluent
dropPrimary(
string|array $index = null)
Indicate that the given primary key should be dropped.
at line line 262
Fluent
dropUnique(
string|array $index)
Indicate that the given unique key should be dropped.
at line line 273
Fluent
dropIndex(
string|array $index)
Indicate that the given index should be dropped.
at line line 284
Fluent
dropForeign(
string|array $index)
Indicate that the given foreign key should be dropped.
at line line 324
void
dropRememberToken()
Indicate that the remember token column should be dropped.
at line line 347
Fluent
primary(
string|array $columns,
string $name = null)
Specify the primary key(s) for the table.
at line line 359
Fluent
unique(
string|array $columns,
string $name = null)
Specify a unique index for the table.
at line line 371
Fluent
index(
string|array $columns,
string $name = null)
Specify an index for the table.
at line line 383
Fluent
foreign(
string|array $columns,
string $name = null)
Specify a foreign key for the table.
at line line 394
Fluent
increments(
string $column)
Create a new auto-incrementing integer (4-byte) column on the table.
at line line 405
Fluent
smallIncrements(
string $column)
Create a new auto-incrementing small integer (2-byte) column on the table.
at line line 416
Fluent
mediumIncrements(
string $column)
Create a new auto-incrementing medium integer (3-byte) column on the table.
at line line 427
Fluent
bigIncrements(
string $column)
Create a new auto-incrementing big integer (8-byte) column on the table.
at line line 439
Fluent
char(
string $column,
int $length = 255)
Create a new char column on the table.
at line line 451
Fluent
string(
string $column,
int $length = 255)
Create a new string column on the table.
at line line 497
Fluent
integer(
string $column,
bool $autoIncrement = false,
bool $unsigned = false)
Create a new integer (4-byte) column on the table.
at line line 510
Fluent
tinyInteger(
string $column,
bool $autoIncrement = false,
bool $unsigned = false)
Create a new tiny integer (1-byte) column on the table.
at line line 523
Fluent
smallInteger(
string $column,
bool $autoIncrement = false,
bool $unsigned = false)
Create a new small integer (2-byte) column on the table.
at line line 536
Fluent
mediumInteger(
string $column,
bool $autoIncrement = false,
bool $unsigned = false)
Create a new medium integer (3-byte) column on the table.
at line line 549
Fluent
bigInteger(
string $column,
bool $autoIncrement = false,
bool $unsigned = false)
Create a new big integer (8-byte) column on the table.
at line line 561
Fluent
unsignedTinyInteger(
string $column,
bool $autoIncrement = false)
Create a new unsigned tiny integer (1-byte) column on the table.
at line line 573
Fluent
unsignedSmallInteger(
string $column,
bool $autoIncrement = false)
Create a new unsigned small integer (2-byte) column on the table.
at line line 585
Fluent
unsignedMediumInteger(
string $column,
bool $autoIncrement = false)
Create a new unsigned medium integer (3-byte) column on the table.
at line line 597
Fluent
unsignedInteger(
string $column,
bool $autoIncrement = false)
Create a new unsigned integer (4-byte) column on the table.
at line line 609
Fluent
unsignedBigInteger(
string $column,
bool $autoIncrement = false)
Create a new unsigned big integer (8-byte) column on the table.
at line line 622
Fluent
float(
string $column,
int $total = 8,
int $places = 2)
Create a new float column on the table.
at line line 635
Fluent
double(
string $column,
int|null $total = null,
int|null $places = null)
Create a new double column on the table.
at line line 648
Fluent
decimal(
string $column,
int $total = 8,
int $places = 2)
Create a new decimal column on the table.
at line line 671
Fluent
enum(
string $column,
array $allowed)
Create a new enum column on the table.
at line line 726
Fluent
dateTimeTz(
string $column)
Create a new date-time column (with time zone) on the table.
at line line 748
Fluent
timeTz(
string $column)
Create a new time column (with time zone) on the table.
at line line 770
Fluent
timestampTz(
string $column)
Create a new timestamp (with time zone) column on the table.
at line line 782
void
nullableTimestamps()
Add nullable creation and update timestamps to the table.
Alias for self::timestamps().
at line line 872
void
morphs(
string $name,
string|null $indexName = null)
Add the proper columns for a polymorphic table.
at line line 959
Fluent
addColumn(
string $type,
string $name,
array $parameters = array())
Add a new column to the blueprint.
at line line 1056
array
getChangedColumns()
Get the columns on the blueprint that should be changed.