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
Eloquent Builder Macros

Eloquent Builder Macros Laravel Package

exyplis/eloquent-builder-macros

This Laravel package adds reusable macros to Eloquent’s query builder, making common filtering, ordering, and query-building tasks shorter and more expressive. Keep models and repositories cleaner by replacing repetitive query code with handy, chainable macros.

View on GitHub
Deep Wiki
Context7

A set of helpful macros for Laravel Eloquent query builder

Frequently asked questions about Eloquent Builder Macros
How do I install exyplis/eloquent-builder-macros in a Laravel application?
Install it with Composer using composer require exyplis/eloquent-builder-macros, then confirm whether Laravel package auto-discovery registers its service provider. If auto-discovery is not supported, add the provider manually according to the package source. Run a sandbox install and a small integration test before adopting it in production.
Which Laravel and PHP versions does this Eloquent macro package support?
The provided overview does not list version constraints, so check the package composer.json for its illuminate/database and PHP requirements. Verify those constraints against your application's Laravel and PHP versions rather than assuming compatibility. Test the macros on your exact framework version because Eloquent builder internals can change between Laravel releases.
What macros are included in exyplis/eloquent-builder-macros?
The package describes itself as a set of helpful Eloquent query builder macros for common filtering, ordering, and query-building tasks. The exact macro names and behavior must be confirmed by reviewing the repository source or README because the excerpt provided does not enumerate them. Inventory each macro against your existing query boilerplate before deciding which ones to use.
Do these macros work with soft deletes, global scopes, and multi-tenancy?
Macros usually extend the same Eloquent builder, so they may compose with soft deletes, global scopes, and tenant constraints, but that behavior is not guaranteed by the overview. Validate generated SQL and bindings in tests that include your global scopes, soft-delete models, and tenant filters. Pay particular attention to any macro that adds raw expressions or changes query structure.
Can these query builder macros collide with my own macros or local scopes?
Macro name collisions are a real risk because macro registration is often global to the query builder. Review the package registration code and compare its macro names with existing application macros and builder methods. If collisions exist, rename your macros, wrap usage, or avoid the conflicting package macro.
How can I disable or selectively enable macros from this package?
The overview does not describe opt-in registration or selective disabling, so inspect the service provider and registration mechanism first. If macros are registered globally, you may need to conditionally register the provider, fork the package, or override behavior in your own service provider. Confirm the approach in a sandbox before relying on it.
Is exyplis/eloquent-builder-macros safe and mature enough for production?
The available assessment shows weak maturity signals: no stars, zero dependents, and a zero score. That does not prove poor quality, but it means maintenance, security review, and compatibility guarantees cannot be assumed. Pin the version, audit the source, run integration tests, and wrap approved usage behind internal helpers before production adoption.
How should I test Eloquent builder macros from this package?
Use integration tests against every production database driver you support and assert both the generated SQL and bound values. Cover interactions with global scopes, soft deletes, tenancy constraints, pagination, chunking, eager loading, and transactions where relevant. A sandbox install plus a focused test suite should precede any production use.
Do I need this package if I already use Eloquent local scopes or query objects?
Not necessarily. The package is a better fit when repeated query-builder patterns create boilerplate and you want chainable, reusable macros. If your domain logic already lives in local scopes, repositories, or query objects, adding a third-party macro layer may reduce clarity and introduce dependency risk.
What are alternatives to using a third-party Eloquent macro package?
You can implement local scopes, custom Eloquent builder classes, query objects, or repository methods instead of installing a package. Laravel's built-in query builder methods and model scopes can cover many filtering and ordering needs. These alternatives keep behavior under your control and avoid maintenance and collision risks from an external macro package.
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.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
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