# fluent-community/2.10.01/app/Models/Meta.php

FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS &amp; Online Courses, version 2.10.01. 63 lines.

- Page: https://pluginprobe.com/plugins/fluent-community/2.10.01/code/app/Models/Meta.php
- Raw: https://pluginprobe.com/plugins/fluent-community/2.10.01/raw/app/Models/Meta.php
- Modified: 2026-07-24T13:35:06+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-community/2.10.01/code/app/Models/Meta.php#L10-L20`.

```php
<?php

namespace FluentCommunity\App\Models;

use FluentCommunity\App\Functions\Utility;

/**
 *  Meta Model - DB Model for Meta table
 *
 *  Database Model
 *
 * @package FluentCommunity\App\Models
 *
 * @version 1.0.0
 *
 * @property int         $id
 * @property string|null $object_type
 * @property int|null    $object_id
 * @property string|null $meta_key
 * @property mixed       $value
 */
class Meta extends Model
{
    protected $table = 'fcom_meta';

    protected $primaryKey = 'id';

    protected $guarded = ['id'];

    protected $fillable = [
        'object_type',
        'object_id',
        'meta_key',
        'value'
    ];

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

    public function getValueAttribute($value)
    {
        return Utility::safeUnserialize($value);
    }

    public function scopeByType($query, $type)
    {
        return $query->where('object_type', $type);
    }

    public function scopeByMetaKey($query, $key)
    {
        return $query->where('meta_key', $key);
    }

    public function scopeByObjectId($query, $objectId)
    {
        return $query->where('object_id', $objectId);
    }

}

```
