I have a field in database, i.e. html_content. The field is nullable and by default is null, but it may contain some HTML content.
Model casts this field using CleanHtml class and the result of $model->html_content when html_content is null is an empty string, instead of null value.
Isn't it supposed to return null value, because null value may indicate certain things when rendering pages on the front-end, etc.?
I have a field in database, i.e.
html_content
. The field is nullable and by default isnull
, but it may contain some HTML content.Model casts this field using
CleanHtml
class and the result of$model->html_content
whenhtml_content
is null is an empty string, instead ofnull
value.Isn't it supposed to return
null
value, becausenull
value may indicate certain things when rendering pages on the front-end, etc.?