Skip to content
View as Markdown

Webhook Model

DB Table Name{wp_db_prefix}_fc_meta
SchemaCheck Schema
Source Filefluent-crm/app/Models/Webhook.php
Name SpaceFluentCrm\App\Models
ClassFluentCrm\App\Models\Webhook

Attributes

AttributeData TypeComment
idInteger
object_typeStringFor Webhook Model, default object_type is webhook
object_idInteger
keyString
valueText
created_atDate Time
updated_atDate 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
  • Returns FluentCrm\App\Models\Webhook

Usage

php
$webhook = $webhook->store($data);

saveChanges($data)

Update webhook data

  • Parameters
    • $data array
  • Returns FluentCrm\App\Models\Webhook

Usage

php
$webhook = $webhook->saveChanges($data);