Answers for "laravel validation required if in array"

PHP
1

how to check exist in array in rule validation laravel

['someProperty' => ['required', Rule::in(['needed', 'stuff'])]];
Posted by: Guest on October-10-2021
1

laravel validation array

$data = $request->validate([
    "name"    => "required|array|min:3",
    "name.*"  => "required|string",
]);
Posted by: Guest on June-08-2021
-1

laravel array validation

use Illuminate\Support\Facades\Validator;

$input = [
    'user' => [
        'name' => 'Taylor Otwell',
        'username' => 'taylorotwell',
        'admin' => true,
    ],
];

Validator::make($input, [
    'user' => 'array:username,locale',
]);
Posted by: Guest on August-15-2021

Code answers related to "laravel validation required if in array"

Browse Popular Code Answers by Language