morningtrain / laravel-economic
This is my package laravel-economic
Requires
- php: ^8.1
- illuminate/contracts: ^10.0|^11.0
- illuminate/http: ^10.0|^11.0
- morningtrain/economic: ^v0.9
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- guzzlehttp/guzzle: ^7.5
- larastan/larastan: ^2.0
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.8|^8.1
- orchestra/testbench: ^8.0|^v9.0
- pestphp/pest: ^2.20
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- spatie/laravel-ray: ^1.26
This package is auto-updated.
Last update: 2024-12-25 12:10:55 UTC
README
This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.
Installation
You can install the package via composer:
composer require morning-train/laravel-e-conomic
Configuring the package
You can publish the config file with:
php artisan vendor:publish --tag="e-conomic-config"
This is the contents of the published config file:
<?php return [ 'app_secret_token' => env('ECONOMIC_APP_SECRET_TOKEN'), 'agreement_grant_token' => env('ECONOMIC_AGREEMENT_GRANT_TOKEN'), /* * This class handles actions on request and response to Economic. */ 'request_logger' => \Morningtrain\LaravelEconomic\RequestLogger\VoidRequestLogger::class, ];
Usage
Creating your own request logger
A request logger is any class that implements \Morningtrain\LaravelEconomic\RequestLogger\RequestLogger
. Here's what that interface looks like.
use GuzzleHttp\Psr7\Response; use Illuminate\Http\Client\Request; use Psr\Http\Message\ResponseInterface; interface RequestLogger { public function onRequest(Request $request); public function onResponse(Response $response): ResponseInterface; }
After creating your own RequestLogger
you must register it in the request_logger
in the e-conomic
config file.
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
Developed by