public function coupon()
    {
        if (isset($this->invoice->discount)) {
            return $this->invoice->discount->coupon->id;
        }
    }
public function coupon()
    {
        if (isset($this->invoice->discount)) {
            return $this->invoice->discount->coupon->id;
        }
    }
public function coupon ( ) { if ( isset ( $ this -> invoice -> discount ) ) { return $ this -> invoice -> discount -> coupon -> id ; } }
Get the coupon code applied to the invoice.

@return string|null
Get the coupon code applied to the invoice .