wiserwebsolutions / laravel-pde-client
Fluent Laravel client for Pennsylvania Department of Education financial, enrollment, assessment, graduation, and staffing data.
Package info
github.com/WiserWebSolutions/laravel-pde-client
pkg:composer/wiserwebsolutions/laravel-pde-client
Requires
- php: ^8.2
- ext-dom: *
- guzzlehttp/guzzle: ^7.5
- guzzlehttp/psr7: ^2.6
- illuminate/contracts: ^10.0|^11.0|^12.0|^13.0
- illuminate/filesystem: ^10.0|^11.0|^12.0|^13.0
- illuminate/http: ^10.0|^11.0|^12.0|^13.0
- illuminate/support: ^10.0|^11.0|^12.0|^13.0
- openspout/openspout: ^4.24
- phpoffice/phpspreadsheet: ^5.9
- spatie/laravel-data: ^4.23
Requires (Dev)
- laravel/pint: ^1.30.4
- orchestra/testbench: ^8.0|^9.0|^10.0|^11.0
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^10.5|^11.0|^12.0
Suggests
- laravel/ai: Optional Laravel AI tools and reference analyst (^1.2; PHP 8.3+, Laravel 12–13).
- laravel/mcp: Optional local PDE MCP server (^1.0).
Provides
None
Conflicts
None
Replaces
None
README
A Laravel client for discovering, downloading, and querying Pennsylvania Department of Education data. Supported domains are financials, enrollment, assessments, graduation, and professional personnel.
Installation
composer require wiserwebsolutions/laravel-pde-client php artisan vendor:publish --tag=pde-client-config
Laravel discovers the provider and PDE facade. PHP 8.2+ and Laravel 10–13 APIs are supported; resolve dependencies for the target PHP/Laravel version.
Query data
use WiserWebSolutions\PDEClient\Facades\PDE; $summaries = PDE::district('124157203')->year('2024-2025') ->financials()->budget()->revenues()->get(); $enrollment = PDE::district('124157203')->year('2024-2025') ->enrollments()->sole(); $results = PDE::district('124157203')->year('2024-2025') ->assessments()->pssa()->allStudents()->get();
get() always returns a collection. first()/sole() select one DTO; financial and enrollment DTOs are year summaries. records() streams flat account/grade records for imports. Omitting a year selects the most recent available year; allYears() opts into history. Select/configure a nine-digit AUN.
Historical fields known to be omitted from a report throw on access by default. Set PDE_CLIENT_MISSING_DATA=return_null to opt into nulls. Suppressed, blank, and unrequested values remain nullable. Availability helpers explain the reason; serialization follows the same policy.
Every record and year summary includes public PDE source citations in provenance. Use $record->sourcesFor('budget'), for example, to find the listing page and exact workbook supporting that field. Combined results distinguish their input datasets. Numeric methods also have sourced variants such as totalWithSources() and varianceWithSources(). See public source citations.
Compare budgets and actuals
$financials = PDE::district('124157203')->year('2019-2020')->financials() ->budgetAndActual()->revenues()->account('6111')->sole(); $account = $financials->accounts->sole(); $budget = $account->budget; $actual = $account->actual; $variance = $account->variance(); // actual minus budget, or null if either is missing
Both amounts share one account object when published for that district and fiscal year. This is also the default without budget()/actual(). See combined financial data for serialized examples, year selection, and availability checks.
Optional AI integrations
Expose all 17 datasets through Laravel AI tools, a reference PDE analyst, or a local MCP server. Integrations are installed independently and share source-backed discovery, safe availability results, and deterministic analysis. See AI and MCP setup.
Documentation
Documentation index: all 17 dataset endpoints includes complete access chains, field definitions, synthetic PHP/JSON examples, and historical limitations.
- Configuration
- Queries and explicit totals
- Combined budgets and actuals
- Historical and missing data
- Public PDE source citations
- All eight raw file accessors
- Next-major upgrade guide
- Release checks
- Feature roadmap
community() is an unsupported placeholder and throws when queried.
Development
composer test
composer format:check
composer analyse
composer audit
The test suite uses synthetic fixture workbooks and validates every documented endpoint example. The compatibility workflow covers supported PHP/Laravel combinations and minimum dependencies. Migration templates and storage guidance are optional consumer references; no consumer database is migrated automatically.
MIT licensed.