Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
Setting
n/a
0 / 0
n/a
0 / 0
0
n/a
0 / 0
1<?php
2
3namespace App\Http\Models;
4
5use App\Observers\SettingObserver;
6use Illuminate\Database\Eloquent\Attributes\ObservedBy;
7use Illuminate\Database\Eloquent\Factories\HasFactory;
8use Illuminate\Notifications\Notifiable;
9
10/**
11 * Setting model for user and global application settings.
12 *
13 * Global settings are identified by user_id = 'app_settings' and is_global = true.
14 * User-specific settings are associated with actual user IDs.
15 *
16 * @property string $_id The MongoDB document ID
17 * @property string $user_id The user ID or 'app_settings' for global settings
18 * @property bool $is_global Whether this is a global settings record
19 * @property float $wage_per_hour Average hourly wage for calculations
20 * @property int $words_per_minute Typing speed in words per minute
21 * @property string $typing_style The typing style setting ('all' or specific)
22 * @property int $typing_speed The typing speed value
23 * @property bool $remove_grammar_on_lose_focus Whether to remove grammar on focus loss
24 * @property string $fly_rewrite FlyRewrite feature status ('enabled'/'disabled')
25 * @property string $fly_grammar FlyGrammar feature status ('enabled'/'disabled')
26 * @property string $fly_grammar_default_language Default language for FlyGrammar
27 * @property array $features Feature flags object with boolean values
28 * @property array $playlists Playlist configurations keyed by identifier
29 * @property array $ignoredInputTypes Array of input types to ignore
30 * @property array $blackListClasses Array of CSS classes to blacklist
31 * @property array $blackListIds Array of element IDs to blacklist
32 * @property array $blackListAttributes Array of attribute name/value pairs to blacklist
33 * @property array $blackListDomainRules Array of domain-specific blacklist rules
34 * @property string|null $csv_split_separator Single-character separator string for CSV exports (e.g., ",", ";", "|")
35 * @property \Carbon\Carbon|null $created_at When the setting was created
36 * @property \Carbon\Carbon|null $updated_at When the setting was last updated
37 */
38#[ObservedBy([SettingObserver::class])]
39class Setting extends Moloquent
40{
41    use HasFactory, Notifiable;
42
43    /**
44     * The user_id value used for global application settings.
45     */
46    public const GLOBAL_USER_ID = 'app_settings';
47
48    /**
49     * The table associated with the model.
50     *
51     * @var string
52     */
53    protected $table = 'settings';
54
55    /**
56     * The attributes that are mass assignable.
57     *
58     * @var array
59     */
60    protected $fillable = [
61        'shortcut_timeout',
62        'shortcut_version',
63        'blocked_domains',
64        'fly_grammar_blocked_domains',
65        'fly_rewrite_blocked_domains',
66        'user_id',
67        'words_per_minute',
68        'wage_per_hour',
69        'typing_style',
70        'typing_speed',
71        'wage_per_hour_history',
72        'override_user_wage_per_hour',
73        'override_user_typing_style',
74        'override_user_flygrammar',
75        'override_user_flyrewrite',
76        'fly_grammar',
77        'fly_rewrite',
78        'company_id',
79        'fly_grammar_default_language',
80        'fly_grammar_settings',
81        'upgrade_coupon_order_displayed',
82        'is_global',
83        'features',
84        'playlists',
85        'ignoredInputTypes',
86        'blackListClasses',
87        'blackListIds',
88        'blackListAttributes',
89        'blackListDomainRules',
90        'remove_grammar_on_lose_focus',
91        'custom_prompts_order_flyengage',
92        'custom_prompts_order_flypost',
93        'custom_fly_write_order',
94        'csv_split_separator',
95    ];
96}