Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
Parameter
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 newFactory
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3namespace App\Http\Models;
4
5use Database\Factories\Http\Models\ParameterFactory;
6use Illuminate\Database\Eloquent\Factories\HasFactory;
7
8/**
9 * Parameter Model
10 *
11 * Represents a system configuration parameter with a polymorphic value.
12 * The value can be a string, number, boolean, array, object, or null.
13 *
14 * @property string $_id The unique identifier
15 * @property string $name The parameter name/key (unique)
16 * @property mixed $value The parameter value (polymorphic type)
17 * @property string|null $metadata_key When set, exposes the parameter in the metadata API with this key name
18 * @property \Carbon\Carbon|null $created_at When the parameter was created
19 * @property \Carbon\Carbon|null $updated_at When the parameter was last updated
20 */
21class Parameter extends Moloquent
22{
23    use HasFactory;
24
25    /**
26     * The table associated with the model.
27     *
28     * @var string
29     */
30    protected $table = 'parameters';
31
32    /**
33     * The attributes that are mass assignable.
34     *
35     * @var array<int, string>
36     */
37    protected $fillable = [
38        'name',
39        'value',
40        'metadata_key',
41    ];
42
43    /**
44     * The attributes that should be cast.
45     *
46     * @var array<string, string>
47     */
48    protected $casts = [
49        'created_at' => 'datetime',
50        'updated_at' => 'datetime',
51    ];
52
53    /**
54     * Create a new factory instance for the model.
55     *
56     * @return ParameterFactory
57     */
58    protected static function newFactory()
59    {
60        return ParameterFactory::new();
61    }
62}