Build a Monthly Subscription App with Laravel Cashier

Resubscribing

Resubscribing a user that has cancelled is easy.

$user->subscription('main')->resume();

We can also do checks to see if a user is on a plan or wants to resume and switch to another plan:

$plan = 'silver';

if ($user->onPlan($plan)) {
    // resume the plan
    $user->subscription('main')->resume();
} else {
    // resume and switch plan
    $user->subscription('main')->resume()->swap($plan);
}