ForeignIdColumnDefinition
class ForeignIdColumnDefinition extends ColumnDefinition
Traits
Properties
| static protected array | $macros | The registered string macros. |
from Macroable |
| protected TValue> | $attributes | All of the attributes set on the fluent instance. |
from Fluent |
| protected Blueprint | $blueprint | The schema builder blueprint instance. |
Methods
Apply the callback if the given "value" is (or resolves to) truthy.
Apply the callback if the given "value" is (or resolves to) falsy.
Retrieve data from the instance.
Determine if the instance contains any of the given keys.
Apply the callback if the instance contains the given key.
Determine if the instance contains a non-empty value for the given key.
Determine if the instance contains an empty value for the given key.
Determine if the instance contains a non-empty value for any of the given keys.
Apply the callback if the instance contains a non-empty value for the given key.
Apply the callback if the instance contains a valid enum value for the given key.
Determine if the instance is missing a given key.
Apply the callback if the instance is missing the given key.
Determine if the given key is an empty string for "filled".
Retrieve data from the instance as a Stringable instance.
Retrieve data from the instance as a Stringable instance.
Retrieve data as a boolean value.
Retrieve data as an integer value.
Retrieve data as a float value.
Retrieve data clamped between min and max values.
Retrieve data from the instance as a Carbon instance.
Retrieve data from the instance as a CarbonInterval instance.
Retrieve data from the instance as an enum.
Retrieve data from the instance as an array of enums.
Retrieve data from the instance as an array.
Retrieve data from the instance as a collection.
Get a subset containing the provided keys with values from the instance data.
Get all of the data except for a specified array of items.
Mix another object into the class.
Dynamically handle calls to the class.
Dynamically handle calls to the class.
Create a new foreign ID column definition.
Get an attribute from the fluent instance using "dot" notation.
Set an attribute on the fluent instance using "dot" notation.
Get an attribute from the fluent instance.
Get the value of the given key as a new Fluent instance.
Convert the fluent instance to pretty print formatted JSON.
Reject partial index modifiers on column definitions.
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
Allow NULL values to be inserted into the column
No description
No description
No description
No description
Set the TIMESTAMP column to use CURRENT_TIMESTAMP as default value
No description
No description
Create a foreign key constraint on this column referencing the "id" column of the conventionally related table.
Specify which column this foreign ID references on another table.
Details
in
Conditionable at line 23
mixed
when(mixed $value = null, callable|null $callback = null, callable|null $default = null)
Apply the callback if the given "value" is (or resolves to) truthy.
in
Conditionable at line 56
mixed
unless(mixed $value = null, callable|null $callback = null, callable|null $default = null)
Apply the callback if the given "value" is (or resolves to) falsy.
in
InteractsWithData at line 29
abstract array
all(mixed $keys = null)
Retrieve all data from the instance.
in
InteractsWithData at line 34
abstract protected mixed
data(string|null $key = null, mixed $default = null)
Retrieve data from the instance.
in
InteractsWithData at line 39
bool
exists(array|string $key)
Determine if the data contains a given key.
in
InteractsWithData at line 47
bool
has(array|string $key)
Determine if the data contains a given key.
in
InteractsWithData at line 66
bool
hasAny(array|string $keys)
Determine if the instance contains any of the given keys.
in
InteractsWithData at line 85
mixed
whenHas(string $key, callable $callback, callable|null $default = null)
Apply the callback if the instance contains the given key.
in
InteractsWithData at line 101
bool
filled(array|string $key)
Determine if the instance contains a non-empty value for the given key.
in
InteractsWithData at line 118
bool
isNotFilled(array|string $key)
Determine if the instance contains an empty value for the given key.
in
InteractsWithData at line 135
bool
anyFilled(array|string $keys)
Determine if the instance contains a non-empty value for any of the given keys.
in
InteractsWithData at line 159
mixed
whenFilled(string $key, callable $callback, callable|null $default = null)
Apply the callback if the instance contains a non-empty value for the given key.
in
InteractsWithData at line 184
mixed
whenEnum(string $key, string $enumClass, callable $callback, callable|null $default = null)
Apply the callback if the instance contains a valid enum value for the given key.
in
InteractsWithData at line 200
bool
missing(array|string $key)
Determine if the instance is missing a given key.
in
InteractsWithData at line 217
mixed
whenMissing(string $key, callable $callback, callable|null $default = null)
Apply the callback if the instance is missing the given key.
in
InteractsWithData at line 233
protected bool
isEmptyString(string $key)
Determine if the given key is an empty string for "filled".
in
InteractsWithData at line 245
Stringable
str(string $key, mixed $default = null)
Retrieve data from the instance as a Stringable instance.
in
InteractsWithData at line 253
Stringable
string(string $key, mixed $default = null)
Retrieve data from the instance as a Stringable instance.
in
InteractsWithData at line 263
bool
boolean(string|null $key = null, bool $default = false)
Retrieve data as a boolean value.
Returns true when value is "1", "true", "on", and "yes". Otherwise, returns false.
in
InteractsWithData at line 271
int
integer(string $key, int $default = 0)
Retrieve data as an integer value.
in
InteractsWithData at line 279
float
float(string $key, float $default = 0.0)
Retrieve data as a float value.
in
InteractsWithData at line 287
int|float
clamp(string $key, int|float $min, int|float $max, int|float $default = 0)
Retrieve data clamped between min and max values.
in
InteractsWithData at line 305
CarbonInterface|null
date(string $key, string|null $format = null, UnitEnum|string|null $tz = null)
Retrieve data from the instance as a Carbon instance.
in
InteractsWithData at line 323
CarbonInterval|null
interval(string $key, Unit|string|null $unit = null)
Retrieve data from the instance as a CarbonInterval instance.
in
InteractsWithData at line 350
mixed
enum(string $key, string $enumClass, mixed $default = null)
Retrieve data from the instance as an enum.
in
InteractsWithData at line 367
array
enums(string $key, string $enumClass)
Retrieve data from the instance as an array of enums.
in
InteractsWithData at line 382
array
array(array|string|null $key = null)
Retrieve data from the instance as an array.
in
InteractsWithData at line 390
Collection
collect(array|string|null $key = null)
Retrieve data from the instance as a collection.
in
InteractsWithData at line 398
array
only(mixed $keys)
Get a subset containing the provided keys with values from the instance data.
in
InteractsWithData at line 420
array
except(mixed $keys)
Get all of the data except for a specified array of items.
in
Macroable at line 28
static void
macro(string $name, callable|object $macro)
Register a custom macro.
Boot-only. Macros persist in a static property for the worker lifetime and apply to every subsequent call on the macroable class.
in
Macroable at line 41
static void
mixin(object $mixin, bool $replace = true)
Mix another object into the class.
Boot-only. Delegates to macro() for each method; registered macros persist in a static property for the worker lifetime.
in
Macroable at line 57
static bool
hasMacro(string $name)
Check if macro is registered.
in
Macroable at line 68
static void
flushMacros()
Flush the existing macros.
Boot or tests only. Clears worker-wide macros; concurrent coroutines may resolve different methods depending on timing.
in
Macroable at line 78
static mixed
__callStatic(string $method, array $parameters)
Dynamically handle calls to the class.
in
Macroable at line 103
mixed
__call(string $method, array $parameters)
Dynamically handle calls to the class.
at line 19
__construct(Blueprint $blueprint, array|object $attributes = [])
Create a new foreign ID column definition.
in
Fluent at line 56
static Fluent
make(array|object $attributes = [])
Create a new fluent instance.
in
Fluent at line 69
mixed
get(string|int|null $key = null, mixed $default = null)
Get an attribute from the fluent instance using "dot" notation.
in
Fluent at line 77
Fluent
set(string|int $key, mixed $value)
Set an attribute on the fluent instance using "dot" notation.
in
Fluent at line 89
Fluent
fill(array|object $attributes)
Fill the fluent instance with an array of attributes.
in
Fluent at line 101
mixed
value(string|int $key, mixed $default = null)
Get an attribute from the fluent instance.
in
Fluent at line 113
Fluent
scope(string $key, mixed $default = null)
Get the value of the given key as a new Fluent instance.
in
Fluent at line 155
array
getAttributes()
Get the attributes from the fluent instance.
in
Fluent at line 165
array
toArray()
Convert the fluent instance to an array.
in
Fluent at line 175
array
jsonSerialize()
Convert the object into something JSON serializable.
in
Fluent at line 185
string
toJson(int $options = 0)
Convert the fluent instance to JSON.
in
Fluent at line 195
string
toPrettyJson(int $options = 0)
Convert the fluent instance to pretty print formatted JSON.
in
Fluent at line 203
bool
isEmpty()
Determine if the fluent instance is empty.
in
Fluent at line 211
bool
isNotEmpty()
Determine if the fluent instance is not empty.
in
Fluent at line 221
bool
offsetExists(mixed $offset)
Determine if the given offset exists.
in
Fluent at line 232
mixed
offsetGet(mixed $offset)
Get the value for a given offset.
in
Fluent at line 243
void
offsetSet(mixed $offset, mixed $value)
Set the value at the given offset.
in
Fluent at line 253
void
offsetUnset(mixed $offset)
Unset the value at the given offset.
in
Fluent at line 263
Traversable
getIterator()
Get an iterator for the attributes.
in
Fluent at line 271
static void
flushState()
Flush all static state.
in
Fluent at line 297
mixed
__get(string $key)
Dynamically retrieve the value of an attribute.
in
Fluent at line 305
void
__set(string $key, mixed $value)
Dynamically set the value of an attribute.
in
Fluent at line 313
bool
__isset(string $key)
Dynamically check if an attribute is set.
in
Fluent at line 321
void
__unset(string $key)
Dynamically unset an attribute.
in
ColumnDefinition at line 47
never
whereNotNull(string $column)
Reject partial index modifiers on column definitions.
in
ColumnDefinition at line 42
$this
after(string $column) Place the column "after" another column (MySQL)
No description
in
ColumnDefinition at line 42
$this
always(bool $value = 'true') Used as a modifier for generatedAs() (PostgreSQL)
No description
in
ColumnDefinition at line 42
$this
autoIncrement() $et INTEGER columns as auto-increment (primary key)
No description
in
ColumnDefinition at line 42
$this
change()
Change the column
in
ColumnDefinition at line 42
$this
charset(string $charset) Specify a character set for the column (MySQL)
No description
in
ColumnDefinition at line 42
$this
collation(string $collation)
Specify a collation for the column
in
ColumnDefinition at line 42
$this
comment(string $comment) Add a comment to the column (MySQL/PostgreSQL)
No description
in
ColumnDefinition at line 42
$this
default(mixed $value)
Specify a "default" value for the column
in
ColumnDefinition at line 42
$this
first() $lace the column "first" in the table (MySQL)
No description
in
ColumnDefinition at line 42
$this
from(int $startingValue) Set the starting value of an auto-incrementing field (MySQL/PostgreSQL)
No description
in
ColumnDefinition at line 42
$this
fulltext(bool|string $indexName = 'null')
Add a fulltext index
in
ColumnDefinition at line 42
$this
generatedAs(Expression $expression = 'null') Create a SQL compliant identity column (PostgreSQL)
No description
in
ColumnDefinition at line 42
$this
instant() $pecify that algorithm = instant should be used for the column operation (MySQL)
No description
in
ColumnDefinition at line 42
$this
index(bool|string $indexName = 'null')
Add an index
in
ColumnDefinition at line 42
$this
invisible() $pecify that the column should be invisible to "SELECT *" (MySQL)
No description
in
ColumnDefinition at line 42
$this
lock("default"|"exclusive"|"none"|"shared" $value) Specify the DDL lock mode for the column operation (MySQL)
No description
in
ColumnDefinition at line 42
$this
nullable(bool $value = 'true')
Allow NULL values to be inserted into the column
in
ColumnDefinition at line 42
$this
primary(bool $value = 'true')
Add a primary index
in
ColumnDefinition at line 42
$this
spatialIndex(bool|string $indexName = 'null')
Add a spatial index
in
ColumnDefinition at line 42
$this
vectorIndex(bool|string $indexName = 'null')
Add a vector index
in
ColumnDefinition at line 42
$this
startingValue(int $startingValue) Set the starting value of an auto-incrementing field (MySQL/PostgreSQL)
No description
in
ColumnDefinition at line 42
$this
storedAs(Expression|string $expression) Create a stored generated column (MySQL/PostgreSQL/SQLite)
No description
in
ColumnDefinition at line 42
$this
type(string $type)
Specify a type for the column
in
ColumnDefinition at line 42
$this
unique(bool|string $indexName = 'null')
Add a unique index
in
ColumnDefinition at line 42
$this
unsigned(bool $value = 'true') Set the INTEGER column as UNSIGNED if value is true (MySQL)
No description
in
ColumnDefinition at line 42
$this
using(Expression|string $expression) Specify a casting expression when changing the column type (PostgreSQL)
No description
in
ColumnDefinition at line 42
$this
useCurrent()
Set the TIMESTAMP column to use CURRENT_TIMESTAMP as default value
in
ColumnDefinition at line 42
$this
useCurrentOnUpdate() $et the TIMESTAMP column to use CURRENT_TIMESTAMP when updating (MySQL)
No description
in
ColumnDefinition at line 42
$this
virtualAs(Expression|string $expression) Create a virtual generated column (MySQL/PostgreSQL/SQLite)
No description
at line 29
ForeignKeyDefinition
constrained(string|null $table = null, string|null $column = null, string|null $indexName = null)
Create a foreign key constraint on this column referencing the "id" column of the conventionally related table.
at line 40
ForeignKeyDefinition
references(string $column, string|null $indexName = null)
Specify which column this foreign ID references on another table.