app/Http/Requests/ServiceRenewalRequest.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()
    {
        $renewal = $this->route('renewal') ? $this->route('renewal')->id : NULL;
        $service = $this->route('service') ? $this->route('service')->id : NULL;
        return [
            'amount'        => 'sometimes|nullable|regex:/[0-9]+[.,]?[0-9]*/|max:8',
            'deadline'      => 'required|date|unique_date_custom:renewals,deadline,' . $renewal . ',id,service_id,' . $service,
            'status'        => ['sometimes', 'required', new EnumValue(RenewalSM::class, false)],
        ];
    }
public function rules ( ) { $ renewal = $ this -> route ( 'renewal' ) ? $ this -> route ( 'renewal' ) -> id : NULL ; $ service = $ this -> route ( 'service' ) ? $ this -> route ( 'service' ) -> id : NULL ; return [ 'amount' => 'sometimes|nullable|regex:/[0-9]+[.,]?[0-9]*/|max:8' , 'deadline' => 'required|date|unique_date_custom:renewals,deadline,' . $ renewal . ',id,service_id,' . $ service , 'status' => [ 'sometimes' , 'required' , new EnumValue ( RenewalSM :: class , false ) ] , ] ; }
Get the validation rules that apply to the request.
Get the validation rules that apply to the request .
//unique:table,column,except,idColumn