dietercoopman/smart
dietercoopman/smart is a Laravel package that adds smart, convenient helpers to your application, simplifying common development tasks and reducing boilerplate. It integrates cleanly with existing Laravel projects so you can write cleaner, more expressive code with minimal setup.
composer require dietercoopman/smart and commit the lockfile change. Because v2.0 is a major bump, read the diff at https://github.com/dietercoopman/smart/compare/v1.9...v2.0 before running composer update — a 1.9 → 2.0 jump almost always carries a PHP/Laravel minimum-version raise and at least one renamed method or signature change.php artisan vendor:publish --tag=smart-config) and diff it against the package's default file rather than overwriting your existing copy.src/ directory: the public surface is typically a trait plus a query-builder scope or facade call, so you can read the whole API in a few minutes.where('name','like',...) chain with the package call in the controller, and paginate the result. Compare output side-by-side with the old query before deleting the old code.$request->string('q') and feed it into the scope, then chain normal Eloquent on top (->with('team')->paginate(25)). The package should compose with the builder, not replace it — if it returns a collection, wrap it yourself.internal_notes column silently exposes it to users.scopeSearchable(Builder $q, ?string $term) on the model or a small action class that handles empty terms, trimming, and the package call. This gives you one place to swap the implementation (e.g. to Scout) later and keeps package-specific syntax out of controllers.paginate(), and add a deterministic tiebreaker (->orderBy('id')) — otherwise page 2 can repeat or skip rows.->withQueryString()), and make sure the search runs against a query object, not a hydrated collection, so pagination stays cheap.assertDatabaseCount, specific IDs in the result set) rather than snapshotting order. Include cases for empty term, single word, multiple words, and a term containing % or _."dietercoopman/smart": "^2.0" and run the upgrade on a branch. Check composer why-not dietercoopman/smart 2.0 to see what's holding you back if resolution fails.README.md between the v1.9 and v2.0 tags — that is usually where renamed methods, dropped config keys, and new required arguments are documented.LIKE '%term%' does not use indexes. For tables past a few hundred thousand rows, measure before shipping. The usual escape hatch is a MySQL FULLTEXT index or Laravel Scout/Meilisearch — keep the package behind your own scope so that swap is a one-file change.% or _ will match far more than intended unless the package escapes it or you do. Pass raw input through a sanitiser and treat anything interpolated into a column or ORDER BY as an injection vector.blank($term) by returning the unfiltered query.->toSql() plus ->getBindings() immediately after the scope call tells you whether the package appended a where, a join, or nothing at all. Do this before assuming the trait isn't applied.composer show dietercoopman/smart after upgrade. Confirm the installed version and its declared PHP/Laravel constraints, then run your test suite — a major bump that "just installs" can still change default behaviour silently.How can I help you explore Laravel packages today?