lorisleiva/laravel-add-select
Laravel Add Select is a small Laravel package that simplifies appending select columns to existing queries. It provides a fluent helper for adding columns or subqueries to Eloquent and query builder selects without rewriting existing select clauses, making incremental query composition cleaner and m...
selectSub/addSelect.Consider it when:
DB::raw strings scattered across repositories.Build internally or look elsewhere when:
selectSub() and addSelect(), so much of the value here is ergonomic sugar you can own and evolve yourself.To executives: A free (MIT), small utility that shortens delivery time on reporting-style screens by letting list pages compute derived values in a single query. It's a tactical accelerator, not a platform decision — near-zero cost, risk contained to internal features. Notably, an equivalent helper is buildable in under a day, so frame it as a time-saver rather than a dependency to standardize on.
To engineering: It provides a fluent way to attach subselects to Eloquent queries, cleaning up the "derived column" pattern that otherwise degrades into raw SQL spread across repositories. Given the package's age and low adoption, the pragmatic recommendation is to adopt the pattern: either pin the package after a compatibility spike, or vendor its roughly 50 lines into an owned trait. That gets us the ergonomics without an unmaintained dependency. One decision needed: pick one approach and document it as the team standard.
How can I help you explore Laravel packages today?