esmaill23
7 months ago
590
5
Laravel

greater than or equal validation rule error :The values under comparison must be of the same type

Posted 7 months ago by esmaill23

my validation rules are as follow:

public function rules()
    {
        return [
            'mid' => 'required|numeric|exists:movies,id',
            'agreement_id' => 'required|numeric|exists:agreements,id',
            'contract_id' => 'required|numeric|exists:contracts,id',
            'download_price' => 'required|numeric|gte:owner_dl_price',
            'owner_dl_price' => 'required|numeric',
            'seen_price' => 'required|numeric',
            'owner_seen_price' => 'required|numeric|lte:seen_price',
            'start_time' => ['required','date_format:Y/n/j',new emptyDuration($this), new inAgreementDuration($this)],
            'end_time' => ['required','date_format:Y/n/j','after_or_equal:start_time',new emptyDuration($this), new inAgreementDuration($this)]
        ];
    }

i get 500 error code when i send download_price null and the error message is :

InvalidArgumentException: The values under comparison must be of the same type

Please sign in or create an account to participate in this conversation.