<?php

namespace App\Domains\Forms\Controllers\AdminApp;

use App\Domains\Forms\Resources\FoodFormResource;
use App\Domains\Forms\Services\FoodFormService;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;

class FoodFormController extends Controller
{
    public function __construct(protected FoodFormService $foodFormService) {}

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