<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class SubscriptionController extends Controller
{
    /**
     * Show current subscription
     */
    public function index()
    {
        return view('subscription.index');
    }

    /**
     * Show available plans
     */
    public function plans()
    {
        return view('subscription.plans');
    }

    /**
     * Subscribe to a plan
     */
    public function subscribe($plan)
    {
        return redirect()->route('subscription.index')->with('success', 'Subscribed successfully!');
    }

    /**
     * Cancel subscription
     */
    public function cancel()
    {
        return redirect()->route('subscription.index')->with('success', 'Subscription cancelled!');
    }

    /**
     * Show invoice
     */
    public function invoice($id)
    {
        return view('subscription.invoice');
    }

    /**
     * Show payment methods
     */
    public function paymentMethods()
    {
        return view('subscription.payment-methods');
    }

    /**
     * Add payment method
     */
    public function addPaymentMethod(Request $request)
    {
        return redirect()->route('subscription.payment-methods')->with('success', 'Payment method added!');
    }
}