jawira/plantuml-encoding
PHP library providing PlantUML text encoding helpers. Use encodep() to convert an @startuml diagram (UTF-8) into the compressed URL-safe string used by plantuml.com. Includes encode6bit(), append3bytes(), and encode64().
This library exposes PlantUML text encoding functions:
encodep()encode6bit()append3bytes()encode64()ℹ️ Usually only encodep() is used.
<?php
use function Jawira\PlantUml\encodep;
$diagram = <<<TXT
@startuml
Bob -> Alice : hello
@enduml
TXT;
$encode = encodep($diagram); // SyfFKj2rKt3CoKnELR1Io4ZDoSa70000
echo "https://www.plantuml.com/plantuml/uml/$encode";
Output: https://www.plantuml.com/plantuml/uml/SyfFKj2rKt3CoKnELR1Io4ZDoSa70000
⚠️ Since v1.0.0, encodep() function expects to receive an UTF-8 string.
$ composer require jawira/plantuml-encoding
These functions are a copy/paste from http://plantuml.com/code-php.
How can I help you explore Laravel packages today?