# fluent-support/trunk/app/Models/Activity.php

Fluent Support – Helpdesk &amp; Customer Support Ticket System, version trunk. 35 lines.

- Page: https://pluginprobe.com/plugins/fluent-support/trunk/code/app/Models/Activity.php
- Raw: https://pluginprobe.com/plugins/fluent-support/trunk/raw/app/Models/Activity.php
- Modified: 2023-12-15T11:35:04+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/fluent-support/trunk/code/app/Models/Activity.php#L10-L20`.

```php
<?php

namespace FluentSupport\App\Models;

use FluentSupport\App\Models\Traits\ActivityTrait;

class Activity extends Model
{
    use ActivityTrait;

    protected $table = 'fs_activities';

    protected $fillable = ['person_id', 'person_type', 'event_type', 'object_id', 'object_type', 'description'];

    public static function boot()
    {
        parent::boot();

        static::creating(function ($model) {
            $model->created_at = current_time('mysql');
            $model->updated_at = current_time('mysql');
        });
    }

    public function person()
    {
        $class = __NAMESPACE__ . '\Person';

        return $this->belongsTo(
            $class, 'person_id', 'id'
        );
    }

}

```
