Input validation with built-in rules, string-based rule parsing, and custom rule support — validate data before it reaches your domain.
composer require marko/validationuse Marko\Validation\Contracts\ValidatorInterface;
$errors = $this->validator->validate([...$request->input(), ...$request->files()], [
'name' => 'required|string|max:100',
'email' => 'required|email',
'age' => 'nullable|integer|min:18',
'avatar' => 'nullable|file|image|max_size:2048',
'photos.*' => 'image|max_size:2048', // every file of a photos[] upload
]);
if ($errors->isNotEmpty()) {
// handle errors
}Full usage, API reference, and examples: marko/validation