如何在 Laravel5 请求类中验证 Money
2022-08-30 15:03:33
我的验证类如下所示
<?php
namespace App\Http\Requests;
use App\Http\Requests\Request;
class PaymentRequest extends Request
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
$rules = array(
'invoiceid'=>'required',
'recieved_amount'=>'required',
'ref_no'=>'required',
'date'=>'required',
'comment'=>'required'
);
}
}
我想验证为“钱”字段 如果输入了除钱以外的任何内容,则应进行验证recieved_amount
任何人都可以在这方面帮助我吗?