mtarld/symbok-bundle
Symfony bundle inspired by Lombok that generates getters, setters, constructors, adders and removers for your PHP classes from simple annotations, cutting boilerplate in entities and DTOs while keeping your code plain, native PHP.
Framework check first. mtarld/symbok-bundle is a Symfony bundle, not a Laravel package. There is no service provider, no facade, no #[Scope]-style integration, and no bridge into the Laravel container. If you are looking at this from a Laravel codebase, the correct move is don't install it — read it as a reference for what annotation-driven accessor generation looks like, and then solve the same problem with PHP 8.1+ constructor property promotion and readonly properties. Installing it in Laravel buys you nothing the language doesn't already give you, and adds an archived vendor to your supply chain.
If you are legitimately inside a Symfony 4/5 codebase with a large boilerplate backlog:
composer require mtarld/symbok-bundle on a throwaway branch — the repo is archived, so treat the version you install as the version you own forever.config/bundles.php.src/ (and the compiler pass that consumes them) — in an archived package the code is the documentation; the README may not have tracked the implementation.@Getter / @Setter above it, run bin/console cache:clear, then var_dump((new ReflectionClass(MyDto::class))->getMethods()) to confirm the generated methods exist. One class, one verification, then stop and decide whether the ergonomics justify the ownership cost.The bundle's model is Lombok-style: you annotate a class or property and a Symfony compiler pass generates accessor/mutator methods at build time.
@Getter / @Setter. The high-value default. One annotation on the class generates accessors for all properties — this is where the "10 lines per property tax" gets paid back. Use it on DTOs and value objects; think twice on Doctrine entities where you want fine-grained control over which fields are mutable.@Getter on a single property is the escape hatch when one field needs a getter but the rest should be write-only, or when one accessor needs custom logic that the generator would clobber. Expect to drop to property-level on ~10–20% of real entities.@Adder / @Remover generate the addFoo / removeFoo pair alongside the getter — the canonical pattern for $tags, $roles, $members properties on Doctrine entities. This is the pattern that reads best in controllers and form types, because addRole('admin') is idiomatic where $user->setRoles(array_merge(...)) is not.@Constructor. Generates an all-args constructor from the class properties. This is the strongest argument for the package on PHP 7.x, because it's the closest thing to constructor promotion you can get without PHP 8. On PHP 8.0+ it is strictly worse than native constructor promotion, and you should skip it.services.yaml entries.readonly, and native attributes remove the motivation for @Constructor, @Getter on immutable DTOs, and — partly — @Setter. Run the numbers: a one-time refactor to PHP 8.1 syntax is cheaper than permanent ownership of an unmaintained fork over more than a quarter.cache:clear, stub regeneration, analysis order in CI) or new team members will burn half a day on it.cache:clear / container compile, i.e. at deploy time, not at test time. Always run a prod-like build (APP_ENV=prod bin/console cache:warmup) before merging, or you will ship cache-warmup crashes.@Setter on a Doctrine entity gives you setters on $id and $createdAt too, which is almost never what you want. Prefer property-level @Setter on entities; reserve class-level for DTOs and value objects.ServiceProvider, and no reusable ecosystem. Writing a bridge converts a vendor concern into a permanent internal maintenance obligation for a capability PHP already provides. If the real requirement is "less getter/setter noise," the answer in 2026 is constructor promotion and readonly, not a 48-star archived Symfony bundle.How can I help you explore Laravel packages today?