sebrave / laravel-carbon-intensity
Wrapper for UK National Grid Carbon Intensity API
dev-main
2021-07-23 07:49 UTC
Requires
- php: ^8.0
- guzzlehttp/guzzle: ^7.3
- illuminate/contracts: ^8.37
- spatie/laravel-package-tools: ^1.4.3
Requires (Dev)
- brianium/paratest: ^6.2
- nunomaduro/collision: ^5.3
- orchestra/testbench: ^6.15
- phpunit/phpunit: ^9.3
- spatie/laravel-ray: ^1.23
- vimeo/psalm: ^4.8
This package is auto-updated.
Last update: 2024-12-23 15:17:30 UTC
README
This Laravel package helps you work with the UK National Grid's Carbon Intensity Forecasting API.
You can read more about the API at their website: https://carbonintensity.org.uk
Installation
You can install the package via composer:
composer require sebrave/laravel-carbon-intensity
Usage
$api = new \Sebrave\LaravelCarbonIntensity\LaravelCarbonIntensity(); // Get current forecast $api->get(); // Get forecast for a Carbon date $api->getByDate(now()); // Get forecast for first part of a UK postcode $api->getByPostcode('EC1V'); // Get a breakdown by fuel type $api->getBreakdown();
Testing
composer test
License
The MIT License (MIT). Please see License File for more information.