October\Rain\Database\Traits\Nullable

Overview

Nullable will set empty attributes to values equivalent to NULL in the database.


Public Methods

public addNullable()

public addNullable($attributes = null): void

addNullable attribute to the nullable attributes list

public checkNullableValue()

public checkNullableValue($value): bool 

checkNullableValue checks if the supplied value is empty, excluding zero.

public initializeNullable()

public initializeNullable(): void

initializeNullable trait for a model

public nullableBeforeSave()

public nullableBeforeSave(): void

nullableBeforeSave will nullify empty fields at time of saving.