Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CleanHtml cast returns an empty string when database value is null #175

Open
lyyka opened this issue Aug 5, 2022 · 0 comments
Open

CleanHtml cast returns an empty string when database value is null #175

lyyka opened this issue Aug 5, 2022 · 0 comments

Comments

@lyyka
Copy link

lyyka commented Aug 5, 2022

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.?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant