2016-10-16 16 views
0

我試圖驗證電話號碼Laravel - 驗證之間:8,11預期

$rules = array(
      'phone' => 'numeric|between:8,11', 
      'mobile' => 'Required|numeric|between:11,15', 
     ); 

這裏不工作的領域

<div class="form-group"> 
    {{ Form::label('phone', 'Phone', array('class'=>'col-sm-2 col-md-3 col-lg-2 row control-label label-input-sm')) }} 
     <div class="col-sm-10 col-md-9 col-lg-10 "> 
{{ Form::text('phone', '', array('class'=>'form-control1', 'placeholder'=>'Phone')) }} 
    </div> 
     </div> 
    <div class="form-group"> 
{{ Form::label('mobile', 'Mobile', array('class'=>'col-sm-2 col-md-3 col-lg-2 row control-label label-input-sm')) }} 
    <div class="col-sm-10 col-md-9 col-lg-10 ">{{ Form::text('mobile', '', array('class'=>'form-control1', 'placeholder'=>'Mobile')) }} 
    </div> 
</div> 

當我寫與8號

一些

手機必須是8和1之間1

我的驗證器有什麼問題嗎?

回答

1

根據文檔,在數字字段之間驗證字段的值是在兩個值之間。

+0

感謝一件事情你想,而不是什麼digits_between規則我要離開現場的數字呢? –