tlijian1989

249 经验值

我知道了,它不够智能的。需要我先告诉它。

$request = [
            'age' => 4
        ];


        $validator = Validator::make($request, [
            'age' => 'numeric|size:4',
        ]);
        dd($validator->errors());
<?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的解释应该是根据类型来的啊

今天早上重新试突然又好了,我估计是网络问题了,之前我用了SS翻墙,也许是诱因吧。

今天早上重新试突然又好了,我估计是网络问题了,之前我用了SS翻墙,也许是诱因吧。

Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/mkdir -p /usr/local/Homebrew
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/Homebrew
==> /usr/bin/sudo /bin/chmod 755 /usr/local/share/zsh /usr/local/share/zsh/site-functions
==> /usr/bin/sudo /usr/sbin/chown lijian /usr/local/Homebrew
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/Homebrew
==> Downloading and installing Homebrew...
remote: Counting objects: 4127, done.
remote: Compressing objects: 100% (2752/2752), done.
error: RPC failed; curl 56 SSLRead() return error -9806tes/s
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
Failed during: git fetch origin master:refs/remotes/origin/master --tags --force --depth=1
lijiandembp:local lijian$

我用shadowsocks翻墙的,我关掉后也是不行。git config --global http.proxy 查看也是没代理

lijiandembp:~ lijian$ sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
Cloning Oh My Zsh...
Cloning into '/Users/lijian/.oh-my-zsh'...
fatal: unable to access 'https://github.com/robbyrussell/oh-my-zsh.git/': Proxy CONNECT aborted
Error: git clone of oh-my-zsh repo failed

GIthub我自己是能上去的,网上说什么代理的问题,搞不太懂,我尝试着设置了代理的IP,依然没用,以前安装没这些事情,有人遇到过吗?

@snail
修改是需要doctrine/dbal,我的问题是因为有 enum类型的列。

@Tomoe
我的操作不是从命名操作,而且操作的也不是enum类型的列。你的意思是只要包含enum类型,做列的修改都会报错吗