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 Extra Laravel Package

partitech/sonata-extra

Partitech Sonata Extra is a PHP package that extends Symfony's Sonata Admin with additional UI helpers, CRUD utilities, and configuration options, making it easier to build and customize powerful backend administration panels faster.

View on GitHub
Deep Wiki
Context7

Getting Started

First, confirm the stack actually matches. partitech/sonata-extra is a Sonata Admin / Symfony / Doctrine package, not a Laravel package. If your app is Laravel + Eloquent, there is no day-to-day leverage to be had — you cannot composer require your way into Sonata Admin admin classes. The realistic options are (a) you already run a Symfony/Sonata back office alongside (or instead of) your Laravel app, or (b) you skip this package. Everything below assumes (a).

Minimal steps for the Symfony/Sonata case:

  1. Pin the install. composer require partitech/sonata-extra:^1.0.16. Do not float below 1.0.16; 1.0.14 emits console noise during Doctrine database setup, which will confuse every fresh-environment onboarding.
  2. Register the bundle in config/bundles.php (or the kernel bundle array) before Doctrine/Sonata console commands are resolved. Ordering is the one thing most likely to break you.
  3. Read composer.json first, not the README. The require block is the only reliable statement of which Sonata Admin, Symfony, Doctrine ORM/DBAL and PHP versions are supported. For a 6-star, 1.0.x package this matters more than any documentation.
  4. Skim the source tree for the four advertised areas — admin extensions, form types / field helpers, dashboard & widget utilities, Twig helpers. Those are your day-to-day surface. Class names are the API; there is no reference doc, so src/ is your manual.
  5. First use case — validate with a clean DB and a clean console. Run bin/console doctrine:schema:update --dump-sql (or doctrine:migrations:migrate) on an empty database and confirm exit code 0 with empty stderr. That single run validates registration ordering, config resolution, and the 1.0.16 fix in one shot.

Where to look first, in order: composer.json → bundle/service definition → src/ directories matching the four advertised feature areas → the 1.0.14...1.0.16 diff.

Implementation Patterns

Extend, don't call. The package's value proposition is that it reduces boilerplate in Sonata admin classes. The correct pattern is to have your own AbstractAdmin base class consume these extensions once, then have every concrete admin inherit from it. Calling package utilities ad hoc from individual admin classes recreates the duplication you installed the package to avoid.

// one place, inherited everywhere
abstract class BaseAdmin extends AbstractAdmin
{
    // register the package's admin extensions here once
}

final class OrderAdmin extends BaseAdmin { /* no per-admin wiring */ }

Group the four feature areas by concern.

Admin extensions — cross-cutting behaviour applied to many admins (audit fields, common actions, list tweaks). Register these on the base admin, or via a dedicated extension registrar service, not per class. Form types / field helpers — use them in configureFormFields() to avoid re-declaring the same field options across CRUD screens. If you find yourself copy-pasting a field definition three times, that's the signal to reach for the package helper. Dashboard and widget utilities — assemble the back-office landing page from these rather than hand-wiring Twig blocks. Twig helpers — use in your admin templates for rendering consistency; do not reimplement formatting in templates.

Layer underneath your own abstractions. One inheritance/extension chain, not two competing registration paths. If you already have a base admin, make it the single entry point for this package. If you already have a form-type registry, funnel the package's form types through it.

Pin in prod, float in CI. ^1.0.16 in composer.json for production branches; a separate CI job tracking 1.0.x head so you see the next patch before it reaches a release branch.

Make CI assert on console cleanliness. The 1.0.16 change is specifically about console output during DB setup. A pipeline that provisions a fresh container, installs, migrates, and asserts exit code 0 and empty stderr catches exactly the class of regression this package produces — and no unit test will.

Keep your own per-version changelog. Upstream notes are one line and a truncated PR title. Maintain a two-column internal table mapping package version → what you changed → what you retested. The upstream changelog will never carry that context.

Budget a compatibility gate per upgrade. Before each bump, check PHP, Symfony, Sonata Admin, and Doctrine ORM/DBAL constraints against your app. Never bundle this patch with an unrelated Symfony or ORM upgrade — if migrations break you won't know which side did it.

Gotchas and Tips

  • Framework mismatch is the headline gotcha. Everything in the release notes concerns Doctrine database setup. In a Laravel app, that phrase has no referent — you have no Doctrine console commands for it to fix. Don't spend a sprint on adapters for a 6-star helper library.
  • 1.0.15 does not appear in the release trail. Notes jump 1.0.14 → 1.0.16. Don't assume the tag exists or contains anything; read 1.0.14...1.0.16 if you need the full picture.
  • The changelog is a truncated PR title, hedged. "Should fix error console when setting up the database with the doctri…" — should. Verify it yourself; don't close your own ticket on the strength of the note.
  • Residual console errors are usually ordering or cache, not the package. Check that the bundle is registered before Doctrine's console commands resolve, and that you aren't resolving services against an unpublished config. Then bin/console cache:clear — a stale compiled container is the single most common cause of "the fix didn't work."
  • Distinguish "hidden" from "gone." Re-run the failing setup command with -vvv. The 1.0.16 fix concerns console reporting; verbosity is how you tell a suppressed error from a resolved one. Add that -vvv run to your upgrade checklist permanently.
  • Read the composer.lock delta on every bump. A 1.0.x patch touching Doctrine integration can drag a transitive DBAL/ORM bump you didn't intend.
  • Treat it as infrastructure, keep the blast radius small. Consume it from your base admin, a bundle config, or console tooling — never from controllers, entities, or message handlers.
  • Extension points are thin at 1.0.x. Prefer published config and your own subclasses over monkey-patching vendor files. Needing to override an internal service is a signal to file an upstream issue, not to fork — at 6 stars you will be maintaining that fork alone.
  • Watch for a 1.0.17. A hedged note plus a version skip suggests follow-up. Budget a short retest window on the next patch rather than assuming 1.0.16 is terminal.
  • When in doubt, the source is the documentation. With no reference docs, a 0.46 score, and 6 stars, verify every helper's behaviour by reading src/ and by an actual console/screen run — never by inference from the package description, which advertises capabilities at a level of generality the code may not match.
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