关于 validator 的 size 验证问题

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Validator;

class TestController extends Controller
{
    public function index()
    {
        $request = [
            'age' => 212
        ];


        $validator = Validator::make($request, [
            'age' => 'size:4',
        ]);
        dd($validator->errors());

    }
}

返回 : he age must be 4 characters.

它当成字符长度去判断了,可我给的是数字啊!手册对size的解释应该是根据类型来的啊

tlijian1989
修改的评论也不能少于六个字哦!