weboptic / podfather-laravel
A Laravel wrapper for the Podfather API
Requires
- php: ^8.2|^8.3
- illuminate/http: ^9.0|^10.0|^11.0|^12.0
- illuminate/support: ^9.0|^10.0|^11.0|^12.0
Requires (Dev)
- orchestra/testbench: ^9.0
- pestphp/pest: ^3.0
- pestphp/pest-plugin-laravel: ^3.0
README
A clean, fluent, and strictly-typed Laravel wrapper for the Podfather API (v1.3.0).
Built for modern PHP 8.3+ and Laravel 10/11+, this package takes the heavy lifting out of connecting your application to the Podfather system.
Requirements
- PHP 8.3 or higher
- Laravel 10.0 or 11.0+
Installation
You can install the package via composer:
composer require your-vendor/podfather-laravel
Publish the configuration file using:
php artisan vendor:publish --provider="Podfather\PodfatherServiceProvider" --tag="config"
Configuration
Add your Podfather API credentials to your application's .env file. You can request an API key from your Podfather account manager.
PODFATHER_API_KEY="your_api_key_here" PODFATHER_BASE_URL="https://external-api.aws.thepodfather.com/v1"
Usage
This package provides a highly readable Facade (Podfather) that dynamically routes to the various API resources.
All HTTP methods return a strictly-typed array containing the JSON response from Podfather. If the API returns an HTTP error (404, 500, etc.), an Illuminate\Http\Client\RequestException will be thrown.
Basic Examples
use Podfather\Facades\Podfather; // Get Account Info $account = Podfather::account()->get(); // Fetch paginated jobs $jobs = Podfather::jobs()->get(['page' => 1]); // Find a specific job by ID $singleJob = Podfather::jobs()->find(12345); // Create a new Vehicle $newVehicle = Podfather::vehicles()->create([ "vehicleRegistration" => "BD51 SMR", "active" => true, "depot" => 123 ]); // Delete a driver Podfather::drivers()->delete(456);
Available Resources
The following resources are mapped and available as chainable methods on the Facade:
Podfather::account()Podfather::customers()Podfather::depots()Podfather::drivers()Podfather::jobs()Podfather::pods()- Additional methods:
->pdf($podId),->images($podId),->signatures($podId)
- Additional methods:
Podfather::runs()- Additional methods:
->release($runId)
- Additional methods:
Podfather::sites()Podfather::templates()Podfather::vehicles()
Testing
This package is fully tested using Pest PHP and Orchestra Testbench.
To run the test suite:
composer test # or ./vendor/bin/pest
License
The MIT License (MIT). Please see License File for more information.