<?php

namespace LaraBB\Settings\UI\Web\Handlers\Admin\Prefix;

use Illuminate\Contracts\View\Factory;
use Illuminate\Contracts\View\View;
use LaraBB\Settings\Actions\Prefix\EditAction;
use LaraBB\Settings\UI\Web\Requests\Prefix\Edit;

/**
 * Class EditHandler
 * @package LaraBB\Settings\UI\Web\Handlers\Admin\Prefix
 */
class EditHandler
{
    /**
     * EditHandler constructor.
     * @param EditAction $editAction
     * @param Factory $view
     */
    public function __construct(private readonly EditAction $editAction, private readonly Factory $view)
    {

    }

    /**
     * @param Edit $request
     * @return View
     */
    public function __invoke(Edit $request): View
    {
        return $this->view->make('settings::admin.prefix.create-edit', $this->editAction->run($request));
    }
}
