PHP Laravel:验证int的输入的验证器

Using PHP Laravel's Validator, how do I check the input for int?

I've tried using is_int but its the wrong direction.

    class ProductsController extends Controller
    {
        public function listproduct(){

  return view('products.listproduct');

}

public function saveproduct(Request $request){

  $this->validate($request, [
      ...
      'payment' => 'required|is_int()',  
      ...
  ]);

Simply read the docs to find the rules you need

$this->validate($request, [
  ...
  'payment' => 'required|integer',  
  ...
]);

Use closure validation or create custom:

$this->validate($request, [
    ...
    'payment' => function ($attribute, $value, $fail) {
        if (!is_int($value)) {
            return $fail($attribute . ' should be integer.');
        }
    }
    ...
]);

Keep in mind that custom rules will not work correctly with min and max rules.