<?php

namespace App\Http\Controllers\Affiliate;

use App\Classes\Modules\Affiliate\ControllersLogic\ListAffiliatesLogic;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Gate;

class ListAffiliatesController
{
    /**
     * @param Request $request
     * @param ListAffiliatesLogic $logic
     * @return JsonResponse
     * @throws \Illuminate\Auth\Access\AuthorizationException
     */
    public function list(Request $request, ListAffiliatesLogic $logic): JsonResponse {
        Gate::authorize('viewAny', \App\Models\Affiliate::class);
        return $logic->execute($request);
    }
}

