# 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


$webhook = FluentCrm\App\Models\Webhook::find(1);

$webhook->id; // returns id
$webhook->value; // returns webhook value
.......
1
2
3
4
5
6

# Fillable Attributes


'object_type',
'object_id',
'key',
'value'
1
2
3
4
5

# 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

$fields = $webhook->getFields();
1

# getSchema()

Get webhook schema which contains name, lists, tags, url & status

  • Parameters
    • none
  • Returns array

# Usage

$schema = $webhook->getSchema();
1

# store($data)

Save webhook data

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

# Usage

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

# saveChanges($data)

Update webhook data

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

# Usage

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