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

Generic Bundle Laravel Package

siganushka/generic-bundle

siganushka/generic-bundle offers reusable generic components for Symfony/PHP projects, helping streamline Doctrine-backed resource setup with shared traits and CRUD helpers. It reduces repetitive boilerplate and keeps application structure consistent and easy to extend.

View on GitHub
Deep Wiki
Context7

Getting Started

  • Require PHP 8.2+ and Symfony 7.4+ before upgrading. This release is not compatible with older PHP/Symfony combinations.
  • Install/update with Composer, then clear caches and rebuild container/services: composer update, bin/console cache:clear.
  • First places to look: the package README/config reference, the new CRUD traits, SerializerDumpCommand, and the Twig/form/paginator integration points.
  • First practical use case: scaffold a simple CRUD controller with the new traits, then run SerializerDumpCommand to inspect the generated serialization config as YAML.
  • If you use KnpPaginator, update templates and PHP calls for the renamed knp_current_page / currentPage before deploying.

Implementation Patterns

  • Use the new CRUD traits to generate or standardize route/controller boilerplate. Keep project-specific authorization and validation in your controller rather than inside the trait.
  • Run SerializerDumpCommand in local/dev or CI to dump serialization metadata to YAML. Commit or diff that file when serialization groups/configuration change.
  • Decorate KnpPaginator via DecoratingKnpPaginator when you need custom page metadata, query params, or template variables without forking paginator logic.
  • Use DateRange and DateRangeType for date-filter forms, reports, and admin list screens. Normalize the range into start/end boundaries before passing it to repositories.
  • In tests, use MockAuthenticatorFactory and MockAuthenticator to simulate authenticated users without building full security tokens manually.
  • Configure FormErrorNormalizer with the new form_error_with_errors context when API clients need nested field errors instead of a flat error list.
  • Use the highlight Twig filter for search-result snippets, but pass already-escaped content or explicitly control escaping based on your template policy.
  • Update custom Twig templates from knp_current_page_number to knp_current_page, and PHP code from currentPageNumber() to currentPage().

Gotchas and Tips

  • Breaking: knp_current_page_number and currentPageNumber were renamed. Search templates and PHP for old names before upgrading.
  • Breaking: JsonResponseListener::onKernelResponseForNoContent() was removed. If you relied on automatic JSON handling for 204 No Content, return explicit responses or add your own listener.
  • Breaking: Nestable is now abstract. Extend it instead of instantiating it directly; check any custom subclasses or service definitions.
  • The PHP 8.2 / Symfony 7.4 minimum is a hard upgrade boundary. Check transitive dependencies and CI images first.
  • The CRUD traits are convenient but can create route/controller conflicts. Review generated routes and naming before enabling them across an existing app.
  • SerializerDumpCommand output is best treated as a debugging/CI artifact. Avoid hand-editing generated YAML unless the package documents it as a source of truth.
  • MockAuthenticator* should only be enabled in test/dev environments; ensure service registration does not leak into production.
  • When decorating KnpPaginator, verify service priority and decoration configuration; otherwise pagination templates may still receive the original paginator.
  • The highlight Twig filter can introduce XSS risk if used with raw user input. Prefer escaped output and test with HTML-bearing search terms.
  • After upgrading, clear cache and run the test suite specifically around forms, serialization, pagination, and authentication mocks.
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