LimeDeck / nova-cashier-overview

Interact with your Stripe subscriptions directly inside Nova.
MIT License
28 stars 18 forks source link

Advanced view does not expand #11

Open asivaneswaran opened 4 years ago

asivaneswaran commented 4 years ago

Hi,

When I click the manage subscription, it does not expand.

And I get this in the response:

{"subscription":null}

asivaneswaran commented 4 years ago

I found the reason. In StripeSubscriptionsController, you do this:

/** @var \Laravel\Cashier\Subscription $subscription */
        $subscription = Subscription::find($subscriptionId);

But you need to retrieve the custom model like you do in the DatabaseSubscriptionsController

$stripeModel = $this->config->get('cashier.model');

        /** @var \Illuminate\Database\Eloquent\Model $billableModel */
        $billableModel = (new $stripeModel());
        /** @var \Laravel\Cashier\Billable|\Illuminate\Database\Eloquent\Model $billable */
        $billable = $billableModel->find($billableId);