app/Http/Requests/VoucherRequest.php
/**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
Get the validation rules that apply to the request.
@return array
Get the validation rules that apply to the request . @return array
public function rules()
    {
        return [
            'reference' => 'required|max:255',
            'voucher' => 'nullable|max:255',
            'value' => 'required_without:percent|numeric|min:0',
            'percent' => 'required_without:value|numeric|min:0|max:100',
            'client_name' => 'nullable|max:255',
            'client_email' => 'nullable|max:255',
            'expiration' => 'nullable',
            'status' => 'in:'.EnumHelper::keys('store.voucher', ','),
        ];
    }
public function rules ( ) { return [ 'reference' => 'required|max:255' , 'voucher' => 'nullable|max:255' , 'value' => 'required_without:percent|numeric|min:0' , 'percent' => 'required_without:value|numeric|min:0|max:100' , 'client_name' => 'nullable|max:255' , 'client_email' => 'nullable|max:255' , 'expiration' => 'nullable' , 'status' => 'in:' . EnumHelper :: keys ( 'store.voucher' , ',' ) , ] ; }
Get the validation rules that apply to the request.
Get the validation rules that apply to the request .