squeak/rat
squeak/rat is a compact Laravel/PHP package that drops into existing projects with minimal setup. It keeps configuration light and its API simple, so you can add it without restructuring your app or fighting extra dependencies.
squeak/rat is a small, low-traffic package (16 stars, zero dependents on record), so treat the first hour as reconnaissance rather than assuming documented behavior.
Install and confirm discovery.
composer require squeak/rat
Then open vendor/squeak/rat/composer.json and check for extra.laravel.providers / extra.laravel.aliases. If present, Laravel auto-discovers the service provider; if not, register it manually in config/app.php (Laravel 10+) or bootstrap/providers.php (Laravel 11+).
Look here first, in this order:
vendor/squeak/rat/README.md — usually the only authoritative usage doc for a package this size.vendor/squeak/rat/src/ — the public surface is almost always a single ServiceProvider plus one or two concrete classes.vendor/squeak/rat/config/ — if a config file ships, this is where defaults and extension points hide.vendor/squeak/rat/tests/ — for under-documented packages the tests are the documentation; they show the intended call signatures.Publish anything publishable.
php artisan vendor:publish --provider="Squeak\Rat\RatServiceProvider"
Run php artisan vendor:publish with no args first and grep the interactive list for rat — the tag name is not guaranteed to be rat-config.
First real use case. Pick the narrowest thing the package does (a single helper call, a facade method, or an artisan command) and exercise it in php artisan tinker before wiring it into application code. With no downstream dependents, you want a working example in isolation before you build on top of it.
Resolve through the container, not new. Even if the class is trivially instantiable, resolve it via app(...) or constructor injection. That way, when you later need to swap the binding in a test or decorate the implementation, you aren't hunting down new Rat() calls.
use Squeak\Rat\Rat; // verify the exact namespace in src/
public function __construct(private Rat $rat) {}
public function handle(): void
{
$this->rat->...; // whatever the primary method is
}
Wrap it in your own thin adapter. Given the package's maturity level, do not let its types leak across your codebase. Define an interface in your app, implement it with a small class that delegates to squeak/rat, and bind it in a service provider. If the package stalls or you outgrow it, you rewrite one file.
// app/Contracts/RatGateway.php
interface RatGateway { public function run(array $payload): mixed; }
// app/Services/SqueakRatGateway.php
final class SqueakRatGateway implements RatGateway
{
public function __construct(private \Squeak\Rat\Rat $rat) {}
public function run(array $payload): mixed
{
return $this->rat->...($payload);
}
}
Config-driven, not hard-coded. If the package reads from config/rat.php, keep your environment-specific values there and reference them via config('rat.…'). Cache the config in deploy (php artisan config:cache) but only after you've verified the package doesn't read config at runtime in a way that breaks under caching — a common failure mode for small packages.
Push slow work to the queue. If the package performs I/O — HTTP calls, filesystem access, external process invocation — wrap the call in a job rather than doing it in a request cycle:
dispatch(function () use ($payload) {
app(RatGateway::class)->run($payload);
})->onQueue('rat');
Test at the boundary. Because there are no dependents and therefore no battle-tested patterns, pin behavior with your own tests the day you adopt it. Prefer faking the adapter over faking the package internals:
$this->mock(RatGateway::class, fn ($m) => $m->shouldReceive('run')->once()->andReturn(true));
Integration point of choice: events. If the package dispatches events (grep src/ for dispatch( or Event::), hook into those rather than subclassing or monkey-patching. Event listeners are the cleanest extension seam in a package you don't control.
composer.lock, and avoid dev-main in production. With 16 stars, a maintainer rebase can and will break your build silently on composer update.squeak/rat in composer.json does not imply Squeak\Rat in PHP. Confirm the PSR-4 root in vendor/squeak/rat/composer.json before writing imports; a wrong use statement produces a confusing "class not found" that looks like a discovery problem.php artisan about / bootstrap/cache/packages.php to confirm the provider registered. In Laravel 11, composer dump-autoload after install is often required before the package manifest regenerates.env() call inside the package's config file becomes null once config:cache runs. If behavior differs between php artisan serve and a cached deploy, this is almost always the cause.php artisan tinker plus app(\Squeak\Rat\...::class) to introspect the object — get_class_methods(), ReflectionClass, and dump(config('rat')) will answer most questions faster than searching.Macroable. Absent all four, vendor-patching is your only recourse — a strong signal to keep the adapter pattern above.How can I help you explore Laravel packages today?