# fluent-boards/2.0.4/app/Models/TaskMeta.php

FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration, version 2.0.4. 43 lines.

- Page: https://pluginprobe.com/plugins/fluent-boards/2.0.4/code/app/Models/TaskMeta.php
- Raw: https://pluginprobe.com/plugins/fluent-boards/2.0.4/raw/app/Models/TaskMeta.php
- Modified: 2025-05-21T10:11: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-boards/2.0.4/code/app/Models/TaskMeta.php#L10-L20`.

```php
<?php

namespace FluentBoards\App\Models;
use FluentBoards\App\Services\Constant;

class TaskMeta extends Model
{
    protected $table = 'fbs_task_metas';

    protected $guarded = ['id'];

    protected $fillable = [
        'task_id',
        'key',
        'value'
    ];

    public function task()
    {
        return $this->belongsTo(Task::class, 'task_id', 'id');
    }

    public function setValueAttribute($value)
    {
        $this->attributes['value'] = \maybe_serialize($value);
    }

    public function getValueAttribute($value)
    {
        return \maybe_unserialize($value);
    }

    public function subtasks()
    {
        return $this->belongsToMany(
            Task::class,
            'fbs_task_metas',
            'value',
            'task_id'
        )->where('key', Constant::SUBTASK_GROUP_CHILD);
    }
}

```
