Documentation

Nullable

Table of Contents

addNullable()  : $this
Adds an attribute to the nullable attributes list
bootNullable()  : void
Boot the nullable trait for a model
checkNullableValue()  : bool
Checks if the supplied value is empty, excluding zero.
nullableBeforeSave()  : void
Nullify empty fields

Methods

addNullable()

Adds an attribute to the nullable attributes list

public addNullable([array<string|int, mixed>|string|null $attributes = null ]) : $this
Parameters
$attributes : array<string|int, mixed>|string|null = null
Return values
$this

bootNullable()

Boot the nullable trait for a model

public static bootNullable() : void
Return values
void

checkNullableValue()

Checks if the supplied value is empty, excluding zero.

public checkNullableValue(string $value) : bool
Parameters
$value : string

Value to check

Return values
bool

nullableBeforeSave()

Nullify empty fields

public nullableBeforeSave() : void
Return values
void

Search results