spits-online / laravel-wefact-api
A Laravel wrapper for the HostFact / WeFact API
Package info
github.com/Spits-online/laravel-wefact-api
pkg:composer/spits-online/laravel-wefact-api
Requires
- php: ^8.0
- ext-json: *
- guzzlehttp/guzzle: ^7.0
- laravel/framework: ~5.8.0||^6.0||^7.0||^8.0||^9.0||^10.0||^11.0||^12.0||^13.0
Requires (Dev)
- orchestra/testbench: ~3.8.0||^4.0||^5.0||^6.0||^9.0.0||^8.22.0||^10.8||^11.0
- php-coveralls/php-coveralls: ^2.4
- phpunit/phpunit: ^8.0||^9.0||^10.5||^11.5||^12.0
This package is not auto-updated.
Last update: 2026-04-22 08:24:49 UTC
README
Installation
composer require spits-online/laravel-wefact-api
php artisan vendor:publish --provider="Spits\WeFactApi\WeFactApiServiceProvider"
Configuration
Set the .ENV variables
WEFACT_API_KEY= WEFACT_BASE_URI=
Or modify the config/wefact.php file.
HostFact
When using HostFact, modify the config/wefact.php and set the type to \Spits\WeFactApi\HostFact::class.
Components
Each method supports default:
- List
- Find
- Show
- Create
- Edit
- Save
Additional methods will be documented on the component.
To start using the functionalities a new Entity must be instantiated.
use Spits\WeFactApi\Entities\Debtor; $debtor = new Debtor();
Optionally an $Identifier parameter may be provided.
When doing so automatically a show object call will be made to the API retrieving the objects data from WeFact.
After this you can use the supported methods
//For the full fields list check WeFact documentation $debtor->create([ 'Intials' => $requestData['Initials'], 'CompanyName' => $requestData['CompanyName'], 'EmailAddress' => $requestData['EmailAddress'], 'PhoneNumber' => $requestData['PhoneNumber'], 'Address' => $requestData['Address'], 'ZipCode' => $requestData['ZipCode'], 'City' => $requestData['City'], 'InvoiceAddress' => $requestData['InvoiceAddress'], ]);
Alternatively the Wefact Facada may be used to instantiate the Entites as listed below.
Debtor
Creditor
use Spits\WeFactApi\Facades\WeFact; WeFact::creditor(1);
CreditInvoice
use Spits\WeFactApi\Facades\WeFact; WeFact::creditInvoice(1);
Debtor
use Spits\WeFactApi\Facades\WeFact; WeFact::debtor(1);
Group
use Spits\WeFactApi\Facades\WeFact; WeFact::group(1);
Invoice
use Spits\WeFactApi\Facades\WeFact; WeFact::invoice(1);
Product
use Spits\WeFactApi\Facades\WeFact; WeFact::product(1);
Quote
use Spits\WeFactApi\Facades\WeFact; WeFact::quote(1);
Service
use Spits\WeFactApi\Facades\WeFact; WeFact::service(1);
Subscription
use Spits\WeFactApi\Facades\WeFact; WeFact::subscription(1);
Ticket
use Spits\WeFactApi\Facades\WeFact; WeFact::ticket(1);
Vps
use Spits\WeFactApi\Facades\WeFact; WeFact::vps(1);
HostFact only Entities
Since WeFact doesn't support domain management a few of the entities are only to be used in combination with HostFact.
These entities are listed below:
Entities\DomainEntities\DomainContractEntities\HostingEntities\SslEntities\Vps