July 2018
Intermediate to advanced
420 pages
8h 46m
English
The Laravel framework offers us many ways to show error messages, and, by default, Laravel's base controller class uses a ValidatesRequests trait that provides methods to validate the incoming HTTP request, including many default rules such as required, email format, date format, string, and much more.
It is pretty simple to use request validation, as we can see in the following code block:
$validatedData = $request->validate([ 'field name' => 'validation rule, can be more than one', 'field name' => 'validation rule', 'field name' => 'validation rule', ... ]);
For example, ...
Read now
Unlock full access