Download the PHP package hyperized/wefact without Composer
On this page you can find all versions of the php package hyperized/wefact. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package wefact
Hostfact API v3.1 for Laravel
Unofficial Laravel package for the HostFact API v3.1.
Requirements
- PHP 8.4+
- Laravel 13 and above (auto-discovery supported)
Installation
Publish the configuration:
Configuration
Add these to your .env file:
Or edit config/Hostfact.php directly:
Usage
Every controller provides a static new() factory that reads configuration from Laravel automatically:
For dependency injection or testing, use fromHttpClient():
See the examples/ directory for more complete usage patterns.
Typed Responses
All API methods return an ApiResponse subclass:
| Response Type | When | Properties |
|---|---|---|
ShowResponse |
Single entity returned | entity (typed entity), data (DataBag) |
ListResponse |
Multiple entities returned | entities (list of typed entities), items (list of DataBag), pagination |
ActionResponse |
Action with no entity data (e.g. markAsPaid) | — |
ErrorResponse |
API returned an error | errors (list of strings) |
All responses share: controller, action, status, date, isSuccess(), isError(), toArray().
Typed Entities
Responses include typed entity objects with IDE autocompletion and strict PHP types:
For list responses:
Available entity classes: Product, Debtor, Invoice, Domain, Hosting, Ssl, Vps, Ticket, Order, PriceQuote, Creditor, Group. Controllers without documented fields (Service, CreditInvoice, Handle) return a DataBag as the entity.
DataBag
The raw API data is also accessible through typed methods on DataBag:
Available Controllers
| Controller | Actions |
|---|---|
CreditInvoice |
show, list, add, edit, delete, partialPayment, markAsPaid, lineAdd, lineDelete, attachmentAdd, attachmentDelete, attachmentDownload |
Creditor |
show, list, add, edit, delete, attachmentAdd, attachmentDelete, attachmentDownload |
Debtor |
show, list, add, edit, checkLogin, updateLoginCredentials, generatePdf, sendEmail, attachmentAdd, attachmentDelete, attachmentDownload |
Domain |
show, list, add, edit, terminate, delete, getToken, lock, unlock, changeNameserver, syncWhois, editWhois, check, transfer, register, autoRenew, listDnsTemplates, getDnsZone, editDnsZone |
Group |
show, list, add, edit, delete |
Handle |
show, list, add, edit, delete, listDomain |
Hosting |
show, list, add, edit, terminate, delete, suspend, unsuspend, create, removeFromServer, getDomainList, emailAccountData, upDowngrade |
Invoice |
show, list, add, edit, delete, credit, partialPayment, markAsPaid, markAsUnpaid, sendByEmail, sendReminderByEmail, sendSummationByEmail, download, lineAdd, lineDelete, attachmentAdd, attachmentDelete, attachmentDownload, block, unblock, schedule, cancelSchedule, paymentProcessPause, paymentProcessReactivate |
Order |
show, list, add, edit, process, lineAdd, lineDelete |
PriceQuote |
show, list, add, edit, delete, sendByEmail, download, accept, decline, lineAdd, lineDelete, attachmentAdd, attachmentDelete, attachmentDownload |
Product |
show, list, add, edit, delete |
Service |
show, list, add, edit, terminate |
Ssl |
show, list, add, edit, terminate, request, markAsInstalled, download, reissue, renew, getStatus, resendApproverEmail, revoke, markAsUninstalled |
Ticket |
show, list, add, edit, delete, addMessage, changeStatus, changeOwner, attachmentDownload |
Vps |
show, list, add, edit, terminate, create, start, pause, restart, suspend, unsuspend, downloadAccountData, emailAccountData |
Design
This package provides a thin wrapper around the HostFact API. It does not validate input parameters. Consult the HostFact API documentation for accepted parameters.
Architecture:
- Controllers extend the abstract
Apiclass and compose capability traits (e.g.,CanShow,CanList,CanAdd) - Each controller implements a corresponding interface
- All API methods accept
array<string, mixed>and return typedApiResponsesubclasses - HTTP transport is handled by Guzzle 7.x
Testing
License
MIT - see LICENSE for details.