Laravel: validate an integer field that needs to be greater than another

前端 未结 8 2211
情歌与酒
情歌与酒 2020-11-27 15:08

I have two fields that are optional only if both aren\'t present:

$rules = [
  \'initial_page\' => \'required_with:end_page|integer|min:1|digits_between:          


        
8条回答
  •  Happy的楠姐
    2020-11-27 15:55

    For Laravel 5.4 it will be:

    $rules = ['end_page'=>'min:'.(int)$request->initial_page]
    

提交回复
热议问题