<?php

use App\Http\Controllers\SuperAdmin\CompanyController;
use App\Http\Controllers\SuperAdmin\DashboardController;
use App\Http\Controllers\SuperAdmin\PlanController;
use App\Http\Controllers\SuperAdmin\SubscriptionController;
use Illuminate\Support\Facades\Route;

Route::middleware(['auth', 'role:super_admin'])
    ->prefix('superadmin')
    ->name('superadmin.')
    ->group(function () {

        Route::get('/',           [DashboardController::class, 'index'])->name('dashboard');
        Route::get('/dashboard',  [DashboardController::class, 'index'])->name('dashboard.index');

        Route::resource('companies',     CompanyController::class)->except(['show']);
        Route::resource('plans',         PlanController::class)->except(['show']);
        Route::resource('subscriptions', SubscriptionController::class)->only(['index']);
    });
