<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
wiserwebsolutions / laravel-lobbyist-legiscan example snippets
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 —
$datasets = $driver->datasets(); // DatasetCollection for the state
$latest = $datasets->latest(); // most recently rebuilt archive
$changed = $datasets->changedSince($lastHashes); // only sessions whose hash moved
$archive = $driver->dataset($latest); // downloads and opens the archive
$archive->bills()->each(fn ($bill) => ...); // LazyCollection, one session at a time
$archive->votes();
$archive->people();
$archive->delete(); // discard the local copy when done
$driver->clearDatasetCache(); // int — files removed