Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| Parameter | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
| newFactory | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Http\Models; |
| 4 | |
| 5 | use Database\Factories\Http\Models\ParameterFactory; |
| 6 | use 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 \Carbon\Carbon|null $created_at When the parameter was created |
| 18 | * @property \Carbon\Carbon|null $updated_at When the parameter was last updated |
| 19 | */ |
| 20 | class Parameter extends Moloquent |
| 21 | { |
| 22 | use HasFactory; |
| 23 | |
| 24 | /** |
| 25 | * The table associated with the model. |
| 26 | * |
| 27 | * @var string |
| 28 | */ |
| 29 | protected $table = 'parameters'; |
| 30 | |
| 31 | /** |
| 32 | * The attributes that are mass assignable. |
| 33 | * |
| 34 | * @var array<int, string> |
| 35 | */ |
| 36 | protected $fillable = [ |
| 37 | 'name', |
| 38 | 'value', |
| 39 | ]; |
| 40 | |
| 41 | /** |
| 42 | * The attributes that should be cast. |
| 43 | * |
| 44 | * @var array<string, string> |
| 45 | */ |
| 46 | protected $casts = [ |
| 47 | 'created_at' => 'datetime', |
| 48 | 'updated_at' => 'datetime', |
| 49 | ]; |
| 50 | |
| 51 | /** |
| 52 | * Create a new factory instance for the model. |
| 53 | * |
| 54 | * @return ParameterFactory |
| 55 | */ |
| 56 | protected static function newFactory() |
| 57 | { |
| 58 | return ParameterFactory::new(); |
| 59 | } |
| 60 | } |