Skip to content

Glossary

Laravel validation: checking data that comes in

The rules deciding which input an application accepts and which it turns away.

Forms, apps, other people’s systems. Every application receives data from outside, and none of it may be processed unchecked. Validation is the set of rules that settles this. An invoice number has to be present, a date has to be a date, an amount must not go negative.

In Laravel these rules sit together in one place rather than spread through the code. That sounds like a formality and is, in practice, the difference between an application whose behaviour you can look up and one where you have to guess.

Error messages are part of the subject matter

The technical side is quickly done. The effort sits in the question of what should happen when an entry does not fit. “Invalid input” helps nobody. “The customer number must be six digits and start with a 4” prevents the second call to support.

No developer can invent texts like these; they come from the people who know the business. When they are missing at the start of a project, placeholders appear and then stand for years. It pays to collect them early.

FAQ

Häufige Fragen

Is checking in the browser not enough?
No, and that is not excessive caution. Anything running in the browser can be switched off or worked around; a request can be sent without a form at all. Checking in the browser is a convenience for honest users, checking on the server is the actual protection. Both together is right; either one alone is not.

Related

Terms that belong with this one

A project, or a question?

Write and tell us what it is about. You get an assessment from somebody who works with Laravel themselves, not from a sales desk.