hl/hiloxa-trigger

Webhook trigger package for hiloxa
8,876
Install
composer require hl/hiloxa-trigger
Latest Version:1.0.0
PHP:>=8.2
License:MIT
Last Updated:Apr 26, 2024
Links: GitHub  ·  Packagist
Maintainer: husseinzaher

Hiloxa trigger

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.

Related Packages

renatoxm/laravel-vonage-dlr-webhooks

Handle delivery receipt SMS webhooks in Laravel php framework

1,426 2
syehan/webhook-plugin

Webhooks allow external services to be notified when certain events happen. When...

1 2
shooka/laravel-modelevents

Let a service provider handle your model events

6,691 6
edofre/laravel-fullcalendar

Laravel component for fullcalendar package

1,846 57
sebdesign/laravel-state-machine

Winzou State Machine service provider for Laravel

1,469,436 341