<?php

namespace LaraBB\Group\Actions\Admin;

use Illuminate\Database\Eloquent\Collection;
use LaraBB\Group\Models\Group;
use LaraBB\Group\Tasks\FindTask as FindGroupTask;
use LaraBB\Group\UI\Web\Requests\Edit;

/**
 * Class EditAction
 * @package LaraBB\Group\Actions\Admin
 */
class EditAction
{

    /**
     * EditAction constructor.
     * @param FindGroupTask $getGroupTask
     */
    public function __construct(private readonly FindGroupTask $getGroupTask)
    {

    }

    /**
     * @param Edit $request
     * @return Group
     */
    public function run(Edit $request): Group
    {
        return $this->getGroupTask->byUuid($request->route('uuid'));
    }
}
