hl / hiloxa-trigger
Webhook trigger package for hiloxa
Installs: 1 701
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^8.0|^8.1|^8.2
- illuminate/database: ^8.0|^9.0|^10.0
- illuminate/http: ^8.0|^9.0|^10.0
- illuminate/queue: ^8.0|^9.0|^10.0
- illuminate/support: ^8.0|^9.0|^10.0
- nesbot/carbon: ^2.53.1|^2.63
- spatie/laravel-package-tools: ^1.9
Requires (Dev)
- orchestra/testbench: ^7.0|^8.0
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2024-04-26 16:48:30 UTC
README
This package adds state support to models.
To give you a feel about how this package can be used, let's look at a quick example.
Installation
You can install the package via composer:
composer require hl/hiloxa-trigger
You can publish the config file with:
php artisan vendor:publish --provider="HL\HiloxaTrigger\HiloxaTriggerServiceProvider" --tag="hiloxa-trigger-config"
This is the content of the published config file:
return [ /* * Which base URL to use for trigger. */ 'base_url' => env('HILOXA_TRIGGER_BASE_URL', 'https://rest.gohighlevel.com/v1'), 'api_key' => env('HILOXA_TRIGGER_API_KEY'), 'trigger' => [ 'create' => true, 'update' => true, ], 'model_data' => \HL\HiloxaTrigger\DTO\CreateDTO::class ];
Imagine a model Customer
, which has : name
, email
and phone
. This package allows you to add your model to Hiloxa
Contact
For the sake of our example, let's say that,
Here's what the Customer
model would look like:
use HL\HiloxaTrigger\Trait\HiloxaTrigger; use HL\HiloxaTrigger\Contracts\HiloxaAble; class Customer extends Model implements HiloxaAble { use HiloxaTrigger; }
Here's a concrete implementation of data class, the CustomerDTO
which refer to valid customer data:
class Customer extends Model implements HiloxaAble { use HiloxaTrigger; public function hiloxaDTO($model): HiloxaDTO { return new CustomerDTO($model); } }
License
The MIT License (MIT). Please see License File for more information.