private function nullIfEmptyArray($key, $value)
    {
        if ($this->isJsonCastable($key) && ! empty($value)) {
            return $this->setJsonCastValue($value);
        }

        return empty($value) ? null : $value;
    }
private function nullIfEmptyArray($key, $value)
    {
        if ($this->isJsonCastable($key) && ! empty($value)) {
            return $this->setJsonCastValue($value);
        }

        return empty($value) ? null : $value;
    }
private function nullIfEmptyArray ( $ key , $ value ) { if ( $ this -> isJsonCastable ( $ key ) && ! empty ( $ value ) ) { return $ this -> setJsonCastValue ( $ value ) ; } return empty ( $ value ) ? null : $ value ; }
Determine whether an array value is empty, taking into account casting.

@param  string  $key
@param  array  $value

@return mixed
Determine whether an array value is empty taking into account casting .