<?php

namespace App\Domains\Forms\Controllers\AdminApp;

use App\Domains\Forms\Resources\EventFormResource;
use App\Domains\Forms\Services\EventFormService;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;

class EventFormController extends Controller
{
    public function __construct(protected EventFormService $eventFormService) {}

    public function __invoke(Request $request): EventFormResource
    {
        return EventFormResource::make(
            $this->eventFormService->get(
                $request->user('sanctum')->tenant()->firstOrFail()
            )
        );
    }
}
