Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Easysvg Laravel Package

kartsims/easysvg

EasySVG is a lightweight PHP library for creating SVG files programmatically. It offers simple methods for adding text, shapes, lines, and paths, making it useful for generating dynamic badges, icons, charts, and other vector graphics in PHP applications.

Deep Wiki
Context7

EasySVG provides a lightweight, fluent PHP API for generating SVG graphics server-side—ideal for badges, labels, charts, and dynamic image output in Laravel or plain PHP applications. Compose drawings programmatically and render them inline or save them as .svg files.

  • Create SVGs with shapes, paths, images, and text
  • Render TrueType text with configurable fonts, sizes, and colors
  • Chainable, readable API for fast composition
  • Output inline SVG or write directly to a file
  • No external graphics extensions required
Frequently asked questions about Easysvg
What is kartsims/easysvg used for?
It is a small, framework-agnostic PHP library for programmatically building SVG defs and symbol structures and serializing them to XML. You use it to compose icon sprites or reusable SVG definitions in PHP instead of hand-authoring sprite files. It belongs at the asset build layer rather than the request path.
Is kartsims/easysvg compatible with Laravel?
Yes by adjacency: it is plain PHP with no Laravel-specific coupling, so it installs cleanly into a Laravel app running a compatible PHP version. There is no service provider, facade, config file, or Artisan command, so you write the integration glue yourself. Expect to add a custom command or Composer script that reads an icon manifest and emits the sprite.
How do I install kartsims/easysvg?
Require it with Composer, for example composer require kartsims/easysvg. There is nothing to publish or configure afterwards because the package ships no Laravel integration. Confirm your runtime image has the DOM extension available, since XML serialization depends on it.
Does kartsims/easysvg support PHP 8 and modern Laravel versions?
The library targets PHP 7 and 8 stacks, and therefore works with Laravel releases running on those versions. The last tagged release was March 2023, so verify the Composer constraint against your PHP ceiling before adopting. If you run newer PHP minors, do a quick install and render test in CI first.
Can I use kartsims/easysvg to generate an SVG icon sprite at build time?
Yes, that is its primary fit. Generate the sprite in a build step or CI job and ship the resulting static SVG as an asset. Keep generation out of the request path so runtime performance is unaffected, and diff generated output against the hand-maintained sprite before cutting over.
Is kartsims/easysvg actively maintained?
It is a small single-maintainer project with roughly 100 stars and a last tagged release in March 2023. That is not automatically disqualifying given the small, auditable surface area, but there is no security-patch SLA and no guarantee of fixes for SVG serialization edge cases. Pin the version, watch PHP upgrades, and be prepared to fork or vendor if upstream stalls.
What are the alternatives to kartsims/easysvg for SVG sprites in Laravel?
If you already run Vite or webpack, an svg-sprite plugin may make this package redundant. Blade-based icon components or a design-system helper solve a different, runtime-flavoured problem. Choose easysvg only when you genuinely want PHP-authored sprite composition emitted as a build artifact.
How should I test kartsims/easysvg output?
Treat the generated SVG as a snapshot artifact: assert against the serialized XML in a unit test and fail on unexpected diffs. Validate rendering across your target browsers during the spike phase, because correctness failures surface as visual bugs rather than PHP exceptions. Add the generation step to CI so drift is caught automatically.
Should I commit the generated SVG sprite to version control?
Either commit it as a reviewed artifact or rebuild it on each deploy, but decide explicitly and document who owns it. Committing makes diffs reviewable and guards against build-time surprises; rebuilding keeps the repo clean but requires deterministic output. Keep the legacy sprite available until parity is proven so the migration stays reversible.
Does kartsims/easysvg require any PHP extensions?
XML serialization relies on PHP's DOM facilities, so make sure ext-dom and related XML extensions are present in your runtime and CI images. Minimal Alpine-based containers sometimes ship without them, which becomes an install-time or runtime failure. Check this before building the generation pipeline around the library.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment