wiserwebsolutions/laravel-lobbyist-legiscan
Composer 安装命令:
composer require wiserwebsolutions/laravel-lobbyist-legiscan
包简介
Default nationwide LegiScan API driver for the laravel-lobbyist package.
README 文档
README
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->listSessions(); // SessionCollection $driver->listBills(); // BillCollection (current CA session master list) $driver->getBill(1132030); // Bill (by LegiScan bill_id) $driver->getBill('AB1'); // Bill (by number — requires state context) $driver->getVote(55); // Vote (by roll_call_id) $driver->listRepresentatives(); // LegislatorCollection (current session people) $driver->getRepresentative(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 (getVote) but not VoteProvider.
Testing
Tests use Http::fake() and never hit the network:
composer install vendor/bin/phpunit
License
MIT © Daniel Wiser
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2026-07-10