kwhorne/askr-laravel
Askr for Laravel is a lightweight package that brings Askr functionality to Laravel applications. It offers simple configuration and a clean, framework-friendly API, making integration straightforward with minimal boilerplate.
Start by reading the package's main CHANGELOG at the linked repo and the README to confirm which drivers ship with the Laravel bridge (config/askr.php is the first place to look after install). The typical setup is:
composer require kwhorne/askr (pin to ^1.8).php artisan vendor:publish --tag=askr-config.bootstrap/providers.php on 11+)..env (driver-specific keys) and cache config with php artisan config:cache.Your first use case should be the smallest integration surface: resolve the driver via the container (app(Askr::class) or the injected contract) and make a single call inside a route or artisan command. Don't wire it into a queue or HTTP controller until you've confirmed the driver resolves and the credentials work. Look first at the driver interface/contract, then at the concrete drivers shipped under src/Drivers/, then at the CHANGELOG for anything in 1.8.x that changed defaults or signature.
Bind-and-inject over facades where possible: the drivers are best consumed through the published contract so you can swap fakes in tests. A common daily pattern is a thin AskrService wrapper that owns your default driver, retry policy, and logging, keeping driver details out of controllers.
For multi-driver setups, register named instances in a service provider:
$this->app->singleton('askr.default', fn ($app) => $app->make(AskrManager::class)->driver(config('askr.default')));
Typical workflows:
tries, backoff, and a timeout slightly above the driver's own timeout.setUp() so unit tests never hit the network; assert on the contract calls rather than driver internals.Integration tips: prefer config-driven driver selection (config('askr.drivers')) over hardcoding class names; keep prompt/payload builders in dedicated classes so driver swaps don't ripple through the app; and cache the resolved manager rather than re-resolving per call.
.env changes until php artisan config:clear. Always clear after editing config/askr.php.register() can fail if credentials aren't loaded yet — resolve lazily in the consuming class or bind a closure.Http:: calls in a custom driver) won't be faked. Bind your custom driver explicitly in tests.1.8.4 is a patch release pointing at the main changelog — read that before bumping, because the bridge's driver set can change with the main package even when the bridge version only ticks the patch number. Lock to ~1.8.0 until you've reviewed the 1.8.x changelog for deprecations.extend()/config map rather than replaced by subclassing the manager. This keeps you upgrade-safe across 1.8.x.How can I help you explore Laravel packages today?