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

Layout Laravel Package

atelier/layout

atelier/layout is a Laravel/PHP package for building reusable page layouts and templates. It provides a clean, configurable API to organize views, reduce duplication, and keep application structure maintainable. Designed for straightforward integration with existing Blade workflows.

View on GitHub
Deep Wiki
Context7

Getting Started

  • Install with composer require ateliersvg/layout and confirm whether Laravel auto-discovery is supported or a service provider must be registered.
  • Look first at the README usage examples, src/, tests, and the newly extracted WrapsText trait. The trait is the clearest signal for how text wrapping is intended to be reused.
  • Start with a small SVG layout containing wrapped text, render it from a controller or Blade view, and return it as an SVG response. This validates installation, namespaces, escaping, and text layout before building larger compositions.
  • Check the package’s PHP/Laravel version constraints and whether any config or assets need publishing.

Implementation Patterns

  • Compose layouts in application code, render to an SVG string, then return, store, cache, or embed the result. Keep layout construction out of Blade where possible; use Blade for presentation around the generated SVG.
  • Use WrapsText for reusable wrapping behavior in custom text nodes or domain-specific layout elements. Centralizing wrapping avoids duplicating line-break logic across views and services.
  • Wrap generation in a small action or service class, especially for reusable outputs such as reports, labels, cards, or email headers.
  • Test generated SVG with string or snapshot assertions. Focus on wrapped text, escaping, dimensions, and representative edge cases rather than full byte-for-byte markup unless the layout is stable.
  • For batch generation, run layout rendering in queued jobs and cache generated SVGs when inputs have not changed.

Gotchas and Tips

  • v0.8.0 is primarily a refactor: WrapsText was extracted into a trait. If you extended or overrode text-related classes in earlier versions, check method visibility, trait conflicts, and any moved behavior before upgrading.
  • Escape user-provided text before placing it in SVG. SVG is XML, not safe HTML; do not assume Blade escaping is sufficient if you are assembling markup manually.
  • Text wrapping is sensitive to font metrics, line height, units, long words, unicode, and empty strings. Test those cases explicitly.
  • Return SVG with the correct content type, e.g. response()->make($svg, 200, ['Content-Type' => 'image/svg+xml']), or embed it inline deliberately.
  • If the package exposes publishable config, publish and version it rather than editing vendor files. Debug by dumping the generated SVG before response headers are sent, and watch the changelog for further trait/API refactors.
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.
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums
rlacerda83/query-parser
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings