# FunnelSubscriber Model
| DB Table Name | {wp_db_prefix}_fc_funnel_subscribers |
|---------------|---------------------------------------------------------------------------|
| Schema | Check Schema |
| Source File | fluent-crm/app/Models/FunnelSubscriber.php |
| Name Space | FluentCrm\App\Models |
| Class | FluentCrm\App\Models\FunnelSubscriber |
## Attributes
| Attribute |
Data Type |
Comment |
| id |
Integer |
|
| funnel_id |
Integer |
|
| starting_sequence_id |
Integer |
|
| next_sequence |
Integer |
|
| subscriber_id |
Integer |
|
| last_sequence_id |
Integer |
|
| next_sequence_id |
Integer |
|
| last_sequence_status |
String |
|
| status |
String |
|
| type |
String |
|
| last_executed_time |
Date Time |
|
| next_execution_time |
Date Time |
|
| notes |
String |
|
| source_trigger_name |
String |
|
| delay |
Integer |
|
| source_ref_id |
Integer |
|
| created_at |
Date Time |
|
| updated_at |
Date Time |
|
## Usage
Please check Model Basic for Common methods.
### Accessing Attributes
```php
$funnelSubscriber = FluentCrm\App\Models\FunnelSubscriber::find(1);
$funnelSequence->id; // returns id
$funnelSequence->type; // returns type
.......
```
## Fillable Attributes
```php
'funnel_id',
'starting_sequence_id',
'next_sequence',
'subscriber_id',
'last_sequence_id',
'next_sequence_id',
'last_sequence_status', // pending | : Default: pending
'status',
'type',
'last_executed_time',
'next_executed_time',
'notes',
'source_trigger_name',
'source_ref_id'
```
## Scopes
This model has the following scopes that you can use
### active()
Shorthand for active funnel subscribers
```php
// get all active funnel subscribers
$funnelSubscribers = FluentCrm\App\Models\FunnelSubscriber::active()->get();
```
## Relations
This model has the following relationship that you can use
### funnel
Get the Funnel related to this funnel subscriber
- returns `FluentCrm\App\Models\Funnel` Model
#### Example:
```php
// Accessing the relationship
$funnel = $funnelSubscriber->funnel;
```
### next_sequence_item
Get the next sequence funnel item
- returns `FluentCrm\App\Models\FunnelSequence` Model
#### Example:
```php
// Accessing the relationship
$nextSequence = $funnelSubscriber->next_sequence_item;
```
### last_sequence
Get all the actions of Funnel Sequence related to this funnel
- returns `FluentCrm\App\Models\FunnelSequence` Model
#### Example:
```php
// Accessing the relationship
$lastSequence = $funnelSubscriber->last_sequence;
```
### metrics
Get all the actions of Funnel Sequence related to this funnel
- returns `FluentCrm\App\Models\FunnelMetric` Model Collection
#### Example:
```php
// Accessing the relationship
$metrics = $funnelSubscriber->metrics;
```
### subscriber
Get all the actions of Funnel Sequence related to this funnel
- returns `FluentCrm\App\Models\FunnelMetric` Model Collection
#### Example:
```php
// Accessing the relationship
$subscriber = $funnelSubscriber->subscriber;
```