jomweb / billplz-laravel
Laravel adapter for Billplz
Installs: 113 824
Dependents: 8
Suggesters: 0
Security: 0
Stars: 33
Watchers: 6
Forks: 10
Open Issues: 1
Requires
- php: ^8.1
- guzzlehttp/guzzle: ^7.2
- illuminate/support: ^10.0 || ^11.0
- jomweb/billplz: ^5.2
- php-http/guzzle7-adapter: ^1.0
Requires (Dev)
- larastan/larastan: ^2.0
- nunomaduro/collision: ^7.5 || ^8.0
- orchestra/pest-plugin-testbench: ^2.0
- orchestra/testbench: ^8.22 || ^9.0
- phpunit/phpunit: ^10.5
This package is auto-updated.
Last update: 2024-10-31 00:31:22 UTC
README
Installation
To install through composer by using the following command:
composer require "jomweb/billplz-laravel"
Configuration
Next add the service provider in config/app.php
.
'providers' => [ // ... Billplz\Laravel\BillplzServiceProvider::class, ],
Aliases
You might want to add Billplz\Laravel\Billplz
to class aliases in config/app.php
:
'aliases' => [ // ... 'Billplz' => Billplz\Laravel\Billplz::class, ],
Billplz Configuration
Next add the configuration in config/services.php
.
<?php return [ // ... 'billplz' => [ 'key' => env('BILLPLZ_API_KEY'), 'version' => env('BILLPLZ_VERSION', 'v4'), 'x-signature' => env('BILLPLZ_X_SIGNATURE'), 'sandbox' => env('BILLPLZ_SANDBOX', false), ], ];
Usages
Creating Client
With jomweb/billplz-laravel
you have the option to initiate the client using the following methods.
Facade
use Billplz\Laravel\Billplz; $bill = Billplz::bill()->create( /* ... */ );
IoC
$bill = resolve('billplz')->bill()->create( /* ... */ );
Dependency Injection
use Billplz\Client; // ... public function createBill(Client $client) { $bill = $client->bill()->create( /* ... */ ); }