Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| AttributeValue | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
| attribute | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Models; |
| 4 | |
| 5 | use Illuminate\Database\Eloquent\Factories\HasFactory; |
| 6 | use Illuminate\Database\Eloquent\Model; |
| 7 | |
| 8 | class AttributeValue extends Model |
| 9 | { |
| 10 | use HasFactory; |
| 11 | |
| 12 | // BUG FIX: was `$guarded = []` (everything mass-assignable). Explicit list is safer. |
| 13 | protected $fillable = ['attribute_id', 'value']; |
| 14 | |
| 15 | public function attribute() |
| 16 | { |
| 17 | return $this->belongsTo(Attribute::class); |
| 18 | } |
| 19 | } |