cashier-mollie
cashier-mollie copied to clipboard
Metadata on subscriptions
It would be nice to have metadata for each subscription so you could save a variable as domain name for example. Currently I am using the name of the subscription as Foreign key to add additional metadata, it would be better to just add some metadata to the subscription itself.
Maybe it can be implemented the same way the cashier stripe package adds additional data to a subscription:
$user->newSubscription('main', 'premium')->create(['option' => $value, 'another_option' => $anotherValue]);
$value = $subscription->metadata->option;
Hi @pascallieverse ,
I agree that it's interesting but it would cause a breaking change. I'll label it for cashier-mollie v2.
@sandervanhooft
Is there any way we can achieve something like this right now? I'm working on a case where I want a User (the Billable Model) to be able to create multiple UserPlan models for itself. The UserPlan model can contain extra metadata.
I want to attach the Subscription to the UserPlan model after the subscription is created / checkout, however where can I pass the UserPlan id to the subscription creation process?
If I'm able to get this to work, the UserPlan model could be a good place for us to store additional metadata for now.
@kyle51north Consider storing the relation elsewhere for now. Perhaps a pivot table?
@kyle51north also, you can define an event listener to fire after the subscription is started.