BookStack\Http\Controllers\TagController::updateForEntity PHP Метод

updateForEntity() публичный Метод

Update the tags for a particular entity.
public updateForEntity ( $entityType, $entityId, Illuminate\Http\Request $request ) : mixed
$entityType
$entityId
$request Illuminate\Http\Request
Результат mixed
    public function updateForEntity($entityType, $entityId, Request $request)
    {
        $entity = $this->tagRepo->getEntity($entityType, $entityId, 'update');
        if ($entity === null) {
            return $this->jsonError("Entity not found", 404);
        }
        $inputTags = $request->input('tags');
        $tags = $this->tagRepo->saveTagsToEntity($entity, $inputTags);
        return response()->json(['tags' => $tags, 'message' => 'Tags successfully updated']);
    }