jair921/searchable
jair921/searchable adds simple full-text search to Laravel Eloquent models. Add a trait, define searchable columns, and query results through a clean scope, with no external search services required. Lightweight, framework-native, and easy to drop into existing apps.
Version 1.10.5 is a compatibility release: it adds Laravel 5.5 support. There are no documented breaking changes, so treat this as a drop-in upgrade rather than a re-evaluation of the package.
composer require vendor/package:"^1.10"
composer update, confirm the provider is registered without touching config/app.php:
php artisan package:discover
Look for the package in bootstrap/cache/packages.php. If it is there, remove any manual providers / aliases entries you were carrying from Laravel 5.4 — leaving them in place is harmless but will mask discovery problems later.php artisan config:clear && php artisan cache:clear
.env, and resolve the package from the container in a single endpoint or artisan command to prove the wiring works before rolling it across the codebase.If you are on Laravel 5.4 or earlier, skip this version's auto-discovery benefits — you still register the provider and alias manually, but nothing in 1.10.5 should break you.
Resolve from the container, not the facade, in application code. Facades are fine in controllers and Blade, but constructor-inject the underlying contract in services, jobs, and listeners. This keeps your code testable and means a future major version swapping the facade name won't ripple through your domain layer.
Bind once in a service provider. If you wrap the package (recommended for anything beyond a single call site), create a thin adapter and bind it in AppServiceProvider::register(). Your application then depends on your interface, and the package becomes an implementation detail you can swap or fake.
Configure through env, publish only what you change. Publish the config with the package's publish tag, then delete or comment out every key you aren't overriding. Republishing on upgrade becomes a diff you can actually read instead of a merge conflict.
Testing. Laravel 5.5's container helpers make this cheap:
$this->instance(Contract::class, $fake);
// or, for facades:
PackageFacade::swap($fake);
Prefer instance() for constructor-injected dependencies and swap() only when the facade is genuinely being used. For package-level work, use Orchestra Testbench and register the provider explicitly in getPackageProviders() — Testbench does not exercise auto-discovery the same way a full app does, which is a common source of "works in the app, fails in the suite" bugs.
Defer the provider if it is heavy. If bootstrapping registers routes, migrations, or listeners you don't need on every request, implement DeferrableProvider so it only resolves when something actually asks for it. This is worth measuring before and after — the win is real on large apps, invisible on small ones.
Queue and event payloads. If you dispatch jobs containing package objects, keep the serialized payload small and prefer passing scalars/IDs. Package internals that look serializable often aren't stable across a patch release.
extra.laravel is malformed — the class simply isn't registered and you get a "target class does not exist" error much later. After upgrading, verify with php artisan package:discover and check bootstrap/cache/packages.php directly.php artisan config:cache snapshots the config file at that moment. If 1.10.5 added or renamed config keys, a stale cache will silently serve the old shape. Always config:clear after any package update, and re-run config:cache in deploy scripts after composer install.bootstrap/cache/packages.php is generated. If your deploy pipeline copies a built artifact, run package:discover as part of the build, or you'll ship a manifest referencing paths that don't exist.^1.10 is right for now, but be deliberate: a * constraint on a package still in the 1.x line will eventually pull a minor release with deprecations. Pin the minor, review the changelog on upgrade.aliases entry alongside auto-discovered aliases, the manual one wins and can point at the wrong class after a namespace change. Pick one mechanism.null or the wrong instance: confirm the provider is in packages.php → confirm config is not cached → confirm your .env keys are spelled exactly as the config expects (env() returns null silently on typos) → check whether a deferred provider is being resolved before the app is fully booted.How can I help you explore Laravel packages today?