Свойство | Type | Description | |
---|---|---|---|
$snakeAttributes | boolean | Indicates whether attributes are snake cased on arrays. |
Свойство | Type | Description | |
---|---|---|---|
$appends | array | The accessors to append to the model's array form. | |
$attributes | array | The model's attributes. | |
$casts | array | The attributes that should be casted to native types. | |
$fillable | array | The attributes that are mass assignable. | |
$guarded | array | The attributes that aren't mass assignable. | |
$hidden | array | The attributes that should be hidden for arrays. | |
$mutatorCache | array | The cache of the mutated attributes for each class. | |
$unguarded | boolean | Indicates if all mass assignment is enabled. | |
$visible | array | The attributes that should be visible in arrays. |
Méthode | Description | |
---|---|---|
__callStatic ( string $method, array $parameters ) : mixed | Handle dynamic static method calls into the method. | |
__construct ( array $attributes = [] ) : void | Create a new Eloquent model instance. | |
__get ( string $key ) : mixed | Dynamically retrieve attributes on the model. | |
__isset ( string $key ) : boolean | Determine if an attribute exists on the model. | |
__set ( string $key, mixed $value ) : void | Dynamically set attributes on the model. | |
__toString ( ) : string | Convert the model to its string representation. | |
__unset ( string $key ) : void | Unset an attribute on the model. | |
addHidden ( array | string | null $attributes = null ) : void | Add hidden attributes for the model. | |
addVisible ( array | string | null $attributes = null ) : void | Add visible attributes for the model. | |
attributesToArray ( ) : array | Convert the model's attributes to an array. | |
cacheMutatedAttributes ( string $class ) : void | Extract and cache all the mutated attributes of a class. | |
fill ( array $attributes ) | Fill the model with an array of attributes. | |
fillable ( array $fillable ) | Set the fillable attributes for the model. | |
forceFill ( array $attributes ) | Fill the model with an array of attributes. Force mass assignment. | |
fromJson ( string $value, boolean $asObject = false ) : mixed | Decode the given JSON back into an array or object. | |
getAttribute ( string $key ) : mixed | Get an attribute from the model. | |
getAttributes ( ) : array | Get all of the current attributes on the model. | |
getFillable ( ) : array | Get the fillable attributes for the model. | |
getGuarded ( ) : array | Get the guarded attributes for the model. | |
getHidden ( ) : array | Get the hidden attributes for the model. | |
getMutatedAttributes ( ) : array | Get the mutated attributes for a given instance. | |
getVisible ( ) : array | Get the visible attributes for the model. | |
guard ( array $guarded ) | Set the guarded attributes for the model. | |
hasGetMutator ( string $key ) : boolean | Determine if a get mutator exists for an attribute. | |
hasSetMutator ( string $key ) : boolean | Determine if a set mutator exists for an attribute. | |
hydrate ( array $items ) : array | Create a collection of models from plain arrays. | |
isFillable ( string $key ) : boolean | Determine if the given attribute may be mass assigned. | |
isGuarded ( string $key ) : boolean | Determine if the given key is guarded. | |
isUnguarded ( ) : boolean | Determine if current state is "unguarded". | |
jsonSerialize ( ) : array | Convert the object into something JSON serializable. | |
newInstance ( array $attributes = [] ) : |
Create a new instance of the given model. | |
offsetExists ( mixed $offset ) : boolean | Determine if the given attribute exists. | |
offsetGet ( mixed $offset ) : mixed | Get the value for a given offset. | |
offsetSet ( mixed $offset, mixed $value ) : void | Set the value for a given offset. | |
offsetUnset ( mixed $offset ) : void | Unset the value for a given offset. | |
reguard ( ) : void | Enable the mass assignment restrictions. | |
replicate ( array $except = null ) : |
Clone the model into a new, non-existing instance. | |
setAppends ( array $appends ) | Set the accessors to append to model arrays. | |
setAttribute ( string $key, mixed $value ) | Set a given attribute on the model. | |
setHidden ( array $hidden ) | Set the hidden attributes for the model. | |
setVisible ( array $visible ) | Set the visible attributes for the model. | |
toArray ( ) : array | Convert the model instance to an array. | |
toJson ( integer $options ) : string | Convert the model instance to JSON. | |
totallyGuarded ( ) : boolean | Determine if the model is totally guarded. | |
unguard ( boolean $state = true ) : void | Disable all mass assignable restrictions. | |
unguarded ( callable $callback ) : mixed | Run the given callable while being unguarded. | |
withHidden ( array | string $attributes ) | Make the given, typically hidden, attributes visible. |
Méthode | Description | |
---|---|---|
asJson ( mixed $value ) : string | Encode the given value as JSON. | |
castAttribute ( string $key, mixed $value ) : mixed | Cast an attribute to a native PHP type. | |
fillableFromArray ( array $attributes ) : array | Get the fillable attributes of a given array. | |
getArrayableAppends ( ) : array | Get all of the appendable values that are arrayable. | |
getArrayableAttributes ( ) : array | Get an attribute array of all arrayable attributes. | |
getArrayableItems ( array $values ) : array | Get an attribute array of all arrayable values. | |
getAttributeFromArray ( string $key ) : mixed | Get an attribute from the $attributes array. | |
getAttributeValue ( string $key ) : mixed | Get a plain attribute (not a relationship). | |
getCastType ( string $key ) : string | Get the type of cast for a model attribute. | |
hasCast ( string $key ) : boolean | Determine whether an attribute should be casted to a native type. | |
isJsonCastable ( string $key ) : boolean | Determine whether a value is JSON castable for inbound manipulation. | |
mutateAttribute ( string $key, mixed $value ) : mixed | Get the value of an attribute using its mutator. | |
mutateAttributeForArray ( string $key, mixed $value ) : mixed | Get the value of an attribute using its mutator for array conversion. |
public __construct ( array $attributes = [] ) : void | ||
$attributes | array | |
Résultat | void |
public __toString ( ) : string | ||
Résultat | string |
public attributesToArray ( ) : array | ||
Résultat | array |
public static cacheMutatedAttributes ( string $class ) : void | ||
$class | string | |
Résultat | void |
protected fillableFromArray ( array $attributes ) : array | ||
$attributes | array | |
Résultat | array |
protected getArrayableAppends ( ) : array | ||
Résultat | array |
protected getArrayableAttributes ( ) : array | ||
Résultat | array |
protected getArrayableItems ( array $values ) : array | ||
$values | array | |
Résultat | array |
public getAttribute ( string $key ) : mixed | ||
$key | string | |
Résultat | mixed |
protected getAttributeFromArray ( string $key ) : mixed | ||
$key | string | |
Résultat | mixed |
protected getAttributeValue ( string $key ) : mixed | ||
$key | string | |
Résultat | mixed |
public getAttributes ( ) : array | ||
Résultat | array |
protected getCastType ( string $key ) : string | ||
$key | string | |
Résultat | string |
public getFillable ( ) : array | ||
Résultat | array |
public getGuarded ( ) : array | ||
Résultat | array |
public getMutatedAttributes ( ) : array | ||
Résultat | array |
public getVisible ( ) : array | ||
Résultat | array |
public hasGetMutator ( string $key ) : boolean | ||
$key | string | |
Résultat | boolean |
public hasSetMutator ( string $key ) : boolean | ||
$key | string | |
Résultat | boolean |
public isFillable ( string $key ) : boolean | ||
$key | string | |
Résultat | boolean |
protected isJsonCastable ( string $key ) : boolean | ||
$key | string | |
Résultat | boolean |
public static isUnguarded ( ) : boolean | ||
Résultat | boolean |
public jsonSerialize ( ) : array | ||
Résultat | array |
public newInstance ( array $attributes = [] ) : |
||
$attributes | array | |
Résultat |
public offsetExists ( mixed $offset ) : boolean | ||
$offset | mixed | |
Résultat | boolean |
public offsetUnset ( mixed $offset ) : void | ||
$offset | mixed | |
Résultat | void |
public setAppends ( array $appends ) | ||
$appends | array |
public setAttribute ( string $key, mixed $value ) | ||
$key | string | |
$value | mixed |
public setVisible ( array $visible ) | ||
$visible | array |
public totallyGuarded ( ) : boolean | ||
Résultat | boolean |
public withHidden ( array | string $attributes ) | ||
$attributes | array | string |
protected array $appends | ||
Résultat | array |
protected array $attributes | ||
Résultat | array |
protected array $casts | ||
Résultat | array |
protected array $fillable | ||
Résultat | array |
protected array $guarded | ||
Résultat | array |
protected static array $mutatorCache | ||
Résultat | array |
public static bool $snakeAttributes | ||
Résultat | boolean |
protected static bool $unguarded | ||
Résultat | boolean |
protected array $visible | ||
Résultat | array |