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 | |
| 3 | namespace App\Http\Models; |
| 4 | |
| 5 | use App\Observers\SettingObserver; |
| 6 | use Illuminate\Database\Eloquent\Attributes\ObservedBy; |
| 7 | use Illuminate\Database\Eloquent\Factories\HasFactory; |
| 8 | use 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 \Carbon\Carbon|null $created_at When the setting was created |
| 35 | * @property \Carbon\Carbon|null $updated_at When the setting was last updated |
| 36 | */ |
| 37 | #[ObservedBy([SettingObserver::class])] |
| 38 | class Setting extends Moloquent |
| 39 | { |
| 40 | use HasFactory, Notifiable; |
| 41 | |
| 42 | /** |
| 43 | * The user_id value used for global application settings. |
| 44 | */ |
| 45 | public const GLOBAL_USER_ID = 'app_settings'; |
| 46 | |
| 47 | /** |
| 48 | * The table associated with the model. |
| 49 | * |
| 50 | * @var string |
| 51 | */ |
| 52 | protected $table = 'settings'; |
| 53 | |
| 54 | /** |
| 55 | * The attributes that are mass assignable. |
| 56 | * |
| 57 | * @var array |
| 58 | */ |
| 59 | protected $fillable = [ |
| 60 | 'shortcut_timeout', |
| 61 | 'shortcut_version', |
| 62 | 'blocked_domains', |
| 63 | 'fly_grammar_blocked_domains', |
| 64 | 'fly_rewrite_blocked_domains', |
| 65 | 'user_id', |
| 66 | 'words_per_minute', |
| 67 | 'wage_per_hour', |
| 68 | 'typing_style', |
| 69 | 'typing_speed', |
| 70 | 'wage_per_hour_history', |
| 71 | 'override_user_wage_per_hour', |
| 72 | 'override_user_typing_style', |
| 73 | 'override_user_flygrammar', |
| 74 | 'override_user_flyrewrite', |
| 75 | 'fly_grammar', |
| 76 | 'fly_rewrite', |
| 77 | 'company_id', |
| 78 | 'fly_grammar_default_language', |
| 79 | 'fly_grammar_settings', |
| 80 | 'upgrade_coupon_order_displayed', |
| 81 | 'is_global', |
| 82 | 'features', |
| 83 | 'playlists', |
| 84 | 'ignoredInputTypes', |
| 85 | 'blackListClasses', |
| 86 | 'blackListIds', |
| 87 | 'blackListAttributes', |
| 88 | 'blackListDomainRules', |
| 89 | 'remove_grammar_on_lose_focus', |
| 90 | 'custom_prompts_order_flyengage', |
| 91 | 'custom_prompts_order_flypost', |
| 92 | 'custom_fly_write_order', |
| 93 | ]; |
| 94 | } |