<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use App\Models\UserSubscription;
use Illuminate\View\View;

final class UserSubscriptionAdminController extends Controller
{
    public function index(): View
    {
        $rows = UserSubscription::query()
            ->with(['user:id,full_name,username,email', 'plan:id,name,slug'])
            ->orderByDesc('id')
            ->paginate(25)
            ->withQueryString();

        return view('admin.user-subscriptions.index', [
            'rows' => $rows,
        ]);
    }
}
