Download the PHP package aybarsm/laravel-pandle without Composer
On this page you can find all versions of the php package aybarsm/laravel-pandle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-pandle
Laravel Pandle
A highly customizable Laravel service provider package for the Pandle (pandle.com) bookkeeping platform API.
Installation
You can install the package via composer:
Configuration
Publish the configuration file:
Add the following environment variables to your .env
file:
Usage
Basic Usage
Architecture & Design
Dependency Injection
This package implements a clean dependency injection pattern with no circular dependencies. All concrete implementations are referenced through their corresponding interfaces (abstracts):
This architectural decision provides several key benefits:
- Performance: No circular dependencies means faster instantiation and reduced memory usage
- Testability: Easy to mock dependencies for unit testing
- Maintainability: Clear separation of concerns and dependencies
- Flexibility: Simple to replace any component without affecting others
- Reliability: Prevents complex dependency chains that can lead to runtime issues
Customisation
The concretes in this package are not extensible. However, the package is designed to be highly customisable. All core components can be replaced with your own implementations by binding them before the PandleServiceProvider registers its defaults.
Available Contracts for Customisation
-
AccessTokenContract
- Default Abstract:
Aybarsm\Laravel\Pandle\Contracts\AccessTokenContract::class
- Default Concrete:
Aybarsm\Laravel\Pandle\AccessToken::class
- Handles access token management
- Default Abstract:
-
HandlerContract
- Default Abstract:
Aybarsm\Laravel\Pandle\Contracts\HandlerContract::class
- Default Concrete:
Aybarsm\Laravel\Pandle\Handler::class
- Manages HTTP requests and response handling
- Singleton by default for consistent request handling
- Default Abstract:
-
CompanyContract
- Default Abstract:
Aybarsm\Laravel\Pandle\Contracts\CompanyContract::class
- Default Concrete:
Aybarsm\Laravel\Pandle\Company::class
- Handles company-specific operations
- Default Abstract:
- ClientContract
- Default Abstract:
Aybarsm\Laravel\Pandle\Contracts\ClientContract::class
- Default Concrete:
Aybarsm\Laravel\Pandle\Client::class
- Main client interface for API interactions
- Singleton by default for connection pooling
- Default Abstract:
Example: Custom Handler Concrete Implementation
Here's an example of implementing a custom handler with logging capabilities:
You can customize the implementations in your AppServiceProvider
's register method:
Error Handling
The package throws PandleException
for API-related errors. You can catch these exceptions to handle errors gracefully:
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.