Answers for "what is validator in laravel"

C#
5

validate laravel

$validatedData = $request->validate([
    'title' => ['required', 'unique:posts', 'max:255'],
    'body' => ['required'],
]);
Posted by: Guest on January-06-2021
0

what is validator in laravel

$validator = Validator::make(
    [
        'name' => 'Dayle',
        'password' => 'lamepassword',
        'email' => '[email protected]'
    ],
    [
        'name' => 'required',
        'password' => 'required|min:8',
        'email' => 'required|email|unique:users'
    ]
);


if ($validator->fails())
{
    // The given data did not pass validation
}
Posted by: Guest on June-12-2021

C# Answers by Framework

Browse Popular Code Answers by Language