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

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

- Page: https://pluginprobe.com/plugins/fluent-community/2.10.01/code/app/Models/UserMeta.php
- Raw: https://pluginprobe.com/plugins/fluent-community/2.10.01/raw/app/Models/UserMeta.php
- Modified: 2025-01-21T12:48:22+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/UserMeta.php#L10-L20`.

```php
<?php

namespace FluentCommunity\App\Models;

use FluentCommunity\Framework\Database\Orm\Model;

class UserMeta extends Model
{
    protected $table = 'usermeta';

    protected $primaryKey = 'umeta_id';

    public $timestamps = false;

    protected $fillable = [
        'user_id',
        'meta_key',
        'meta_value'
    ];

    /**
     * Get the user that owns the meta.
     */
    public function user()
    {
        return $this->belongsTo(User::class, 'user_id', 'ID');
    }

    /**
     * Scope query to get meta by key
     */
    public function scopeByKey($query, $key)
    {
        return $query->where('meta_key', $key);
    }

    /**
     * Scope query to get meta by user ID
     */
    public function scopeByUser($query, $userId)
    {
        return $query->where('user_id', $userId);
    }
}

```
