app/Subscriptions/Coupon.php
public function jsonSerialize()
    {
        return [
            'id' => $this->id,
            'months' => $this->months,
            'lastsOnce' => $this->lastsOnce,
            'lastsForever' => $this->lastsForever,
            'amountOff' => $this->amountOff,
            'percentOff' => $this->percentOff,
            'expiresOn' => $this->expiresOn ? $this->expiresOn->format('Y-m-d') : null,
        ];
    }
public function jsonSerialize()
    {
        return [
            'id' => $this->id,
            'months' => $this->months,
            'lastsOnce' => $this->lastsOnce,
            'lastsForever' => $this->lastsForever,
            'amountOff' => $this->amountOff,
            'percentOff' => $this->percentOff,
            'expiresOn' => $this->expiresOn ? $this->expiresOn->format('Y-m-d') : null,
        ];
    }
Get the JSON serializable fields for the object.

@return array