📜  laravel 验证数组输入 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:28.490000             🧑  作者: Mango

代码示例5
use Illuminate\Support\Facades\Validator;

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

Validator::make($input, [
    'user' => 'array:username,locale',
]);