S
S
suhuxa12017-07-31 16:38:56
Laravel
suhuxa1, 2017-07-31 16:38:56

Can Laravel somehow help with preparing data for sending to the database?

Are there any functions in Laravel that, for example, would remove spaces from the login (when registering users), remove dangerous tags, and so on? Or use native functions like trim(), strip_tags, or a regular expression?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Melikhov, 2017-07-31
@amelihovv

Laravel has a built-in middleware that trims all input data, TrimStrings. There is nothing built-in for other data sanitization logic. But there are third party packages, I would recommend this one https://github.com/daylerees/sanitizer

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question