Webhook Model
| DB Table Name | {wp_db_prefix}_fc_meta |
|---|---|
| Schema | Check Schema |
| Source File | fluent-crm/app/Models/Webhook.php |
| Name Space | FluentCrm\App\Models |
| Class | FluentCrm\App\Models\Webhook |
Attributes
| Attribute | Data Type | Comment |
|---|---|---|
| id | Integer | |
| object_type | String | For Webhook Model, default object_type is webhook |
| object_id | Integer | |
| key | String | |
| value | Text | |
| created_at | Date Time | |
| updated_at | Date Time |
Usage
Please check Model Basic for Common methods.
Accessing Attributes
php
$webhook = FluentCrm\App\Models\Webhook::find(1);
$webhook->id; // returns id
$webhook->value; // returns webhook value
.......Fillable Attributes
php
'object_type',
'object_id',
'key',
'value'Methods
Along with Global Model methods, this model has few helper methods.
getFields()
Get all fields (custom_fields & other fields) for webhook setup
- Parameters
- none
- Returns
array
Usage
php
$fields = $webhook->getFields();getSchema()
Get webhook schema which contains name, lists, tags, url & status
- Parameters
- none
- Returns
array
Usage
php
$schema = $webhook->getSchema();store($data)
Save webhook data
- Parameters
- $data
array
- $data
- Returns
FluentCrm\App\Models\Webhook
Usage
php
$webhook = $webhook->store($data);saveChanges($data)
Update webhook data
- Parameters
- $data
array
- $data
- Returns
FluentCrm\App\Models\Webhook
Usage
php
$webhook = $webhook->saveChanges($data);