Skip to content

Instantly share code, notes, and snippets.

@driesvints
Created February 15, 2020 00:24
Show Gist options
  • Save driesvints/78c2ef78c575a428ff4823f0e4b0afbe to your computer and use it in GitHub Desktop.
Save driesvints/78c2ef78c575a428ff4823f0e4b0afbe to your computer and use it in GitHub Desktop.
<?php
class CashierSubscriptions implements Subscriptions
{
public function startSubscription($billable, $subscription, $plan)
{
return $billable->newSubscription($subscription, $plan)->create();
}
}
<?php
use Laravel\Cashier\Subscription;
class FakeSubscriptions implements Subscriptions
{
public function startSubscription($billable, $subscription, $plan)
{
return Subscription::create([
'name' => $subscription,
'stripe_id' => '',
'stripe_status' => 'active',
'stripe_plan' => $plan,
]);
}
}
<?php
interface Subscriptions
{
public function startSubscription($billable, $subscription, $plan);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment