PHP code example of wiserwebsolutions / laravel-lobbyist-legiscan

1. Go to this page and download the library: Download wiserwebsolutions/laravel-lobbyist-legiscan library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?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
bash
php artisan vendor:publish --tag=lobbyist-legiscan-config