Looking to hire Laravel developers? Try LaraJobs

laravel-lobbyist-legiscan maintained by wiserwebsolutions

Description
Default nationwide LegiScan API driver for the laravel-lobbyist package.
Author
Last update
2026/09/02 13:19 (dev-main)
License
Links
Downloads
65

Comments
comments powered by Disqus

Laravel Lobbyist — LegiScan Driver

The default nationwide driver for wiserwebsolutions/laravel-lobbyist, backed by the LegiScan API. It provides legislative data for all 50 states and the federal government and registers itself with the Lobbyist manager under the legiscan name (the default driver).

Installation

composer require wiserwebsolutions/laravel-lobbyist-legiscan

The package auto-registers. Publish its config if you want to tune requests or caching:

php artisan vendor:publish --tag=lobbyist-legiscan-config

Configuration

Set your LegiScan API key in .env:

LEGISCAN_API_KEY=your-key-here

# optional
LEGISCAN_BASE_URI=https://api.legiscan.com/
LEGISCAN_TIMEOUT=30
LEGISCAN_RETRY_TIMES=2
LEGISCAN_CACHE_ENABLED=true
LEGISCAN_CACHE_STORE=
LEGISCAN_CACHE_TTL=3600

Responses are cached per operation (sessions/people for a day, bills/roll calls for an hour) via the configured cache store.

Usage

use WiserWebSolutions\Lobbyist\Facades\Lobbyist;

$driver = Lobbyist::state('CA'); // LegiscanDriver, scoped to California

$driver->sessions();          // SessionCollection
$driver->bills();             // BillCollection (current CA session master list)
$driver->bill(1132030);       // Bill (by LegiScan bill_id)
$driver->bill('AB1');         // Bill (by number — requires state context)
$driver->vote(55);            // Vote (by roll_call_id)
$driver->representatives();   // LegislatorCollection (current session people)
$driver->representative(9001); // Legislator (by people_id)

Supported capabilities

LegiScan supports every capability except ListVotes — the API has no cheap "all votes for a state" operation (roll calls are reached per bill or by id), so this driver implements VoteLookup (vote($id)) but not VoteProvider.

Testing

Tests use Http::fake() and never hit the network:

composer install
vendor/bin/phpunit

License

MIT © Daniel Wiser