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

Sonata Annotation Bundle Laravel Package

kunicmarko/sonata-annotation-bundle

A Symfony bundle that lets you configure Sonata Admin classes with PHP annotations instead of YAML or PHP config. Define admin services plus list, form, show, and datagrid fields directly in annotations, keeping your admin setup compact and close to your entities.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Stack-fit gate first: despite being filed as a "Laravel/PHP package," this is a Symfony + Sonata Admin bundle. It only enters the conversation if our back-office runs on Sonata Admin; for Laravel it is a non-option and should be closed out immediately.
  • Admin config architecture (build vs. buy vs. borrow): the package's only real value is a convention — declare admin services, form fields, datagrid columns, filters, and routes as annotations on the entity instead of hand-writing YAML/XML per entity. That is a design decision about where admin configuration lives (co-located with the domain model vs. a separate admin layer), and it is worth a spike even if we never install the package.
  • Back-office velocity / time-to-first-admin-screen: for products with many CRUD-shaped entities (content, catalogs, users, order admin), per-entity boilerplate is a real tax. The decision this informs: do we invest in a shared admin convention to cut that per-entity setup cost, and does it pay back at our entity count?
  • Roadmap framing for Sonata version upgrade: Sonata's own direction has moved toward native PHP attributes / explicit config over doctrine annotations. This package is a data point that the annotation approach was viable in the 3.x era and was not carried forward — useful input to an upgrade plan, not a dependency to plan around.
  • Opportunity signal: the scoring split (opportunity 4.39 vs. overall 0.1575) says the problem is still real and underserved while this implementation is dead. That supports a "re-implement the convention with PHP 8 attributes in-house" decision over an adoption decision. The 1.2.1 patch does not move this signal — a single field-ordering option is not evidence of renewed stewardship.
  • Field-layout granularity (minor, new in 1.2.1): DatagridField and DatagridAssociationField now accept a position option, so column ordering in the datagrid is declared alongside the field rather than in separate Sonata config. This is a small but concrete confirmation that "admin layout belongs with the field declaration" is a workable ergonomic — useful evidence for the in-house convention's design, not a reason to adopt.
  • Explicitly not supported by this package: any decision requiring vendor support, security patching, or a maintained dependency — see adoption criteria below.

When to Consider This Package

Consider it (narrowly) when all of the following hold:

  • The stack is Symfony with Sonata Admin on a 3.x-era baseline, on the PHP version that era supported.
  • We have a large, stable set of entities with predictable CRUD admin needs, where YAML boilerplate is measurably slowing delivery.
  • We are evaluating the pattern — a 1–2 day spike or reading the source as a reference implementation is legitimate.
  • We accept ownership: forking, pinning, and maintaining it ourselves, isolated behind our own bundle so it can be swapped for native attributes later.

Look elsewhere — or decline — when any of these hold:

  • Any Laravel application. Wrong framework; use Filament, Nova, Backpack, or Orchid instead.
  • Greenfield or modern Sonata. Use native PHP attributes / built-in admin config, or evaluate EasyAdmin for a lighter footprint.
  • Maintenance and risk tolerance matter. Hard blockers: archived repository, 21 stars, 0 dependents, single maintainer, no security response, no compatibility work for current PHP/Symfony/Sonata. The 1.2.1 patch (a position option on datagrid fields) is a drive-by feature addition, not a signal of revival — there is still no community, no CVE coverage, and no commitment to upstream fixes. Every bug remains ours, and the release cadence is now less predictable than a hard archive, not more.
  • Annotations specifically are the requirement. On PHP 8+, attributes plus a small in-house mapping layer deliver the same ergonomics — including field ordering — without a dead dependency.
  • Regulated, audited, or long-lived product surface where dependency provenance and supportability are review criteria.
  • Anyone citing 1.2.1 as "actively maintained." One minor option after a multi-year gap is a bus-factor illustration, not a maintenance guarantee; treat it as unmaintained-with-occasional-patches.

Net: treat this as a reference implementation and pattern source, not an adoptable dependency. The defensible recommendation is unchanged — decline adoption, and if the problem is real for us, spend a short spike cloning the convention (field ordering included) onto native attributes.

How to Pitch It (Stakeholders)

To executives: This is a small, MIT-licensed helper that reduces repetitive back-office configuration by letting engineers describe admin screens directly on their data classes. It is cheap and does one thing well — but it has essentially no users, a single maintainer, and only sporadic fixes (the newest release is a minor field-ordering option after a long dormancy). So the recommendation is not to adopt it as a dependency. Instead, if back-office setup speed is a bottleneck, we take the idea (a few days of engineering, no license cost) and implement it on modern PHP features we control. That converts an unsupported dependency into an owned, maintainable internal convention with no vendor risk and no recurring cost.

To engineering: Scope check first — this is Symfony/Sonata Admin only, irrelevant to our Laravel services. Where it applies, it maps entity-level annotations to Sonata admin service definitions, form/datagrid field declarations, filters, and routes, replacing per-entity YAML; 1.2.1 adds a position option to DatagridField / DatagridAssociationField so column order is declared with the field. That is the whole delta — no breaking changes, no deprecations, no new framework support. It remains single-maintainer with zero dependents, so assume we own every line and every incompatibility. Proposed path: one-day spike against our Sonata version, fork and pin if we proceed, keep it behind our own bundle boundary, and target native PHP attributes as the replacement so the boundary can be deleted rather than maintained. If the spike shows the boilerplate saving — including field ordering — is under a day per quarter, we stop there and do nothing.

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.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource