Add Filaments module with Seeder, update Calculator UI for filament selection, and upgrade dependencies for Livewire Flux

This commit is contained in:
2026-01-25 11:49:17 +01:00
parent ec37f6b421
commit b1e2ab8978
6 changed files with 249 additions and 17 deletions
+4 -4
View File
@@ -13,7 +13,7 @@ class Filament extends Model
protected $fillable = [
'name',
'description',
'type_id',
'filament_type_id',
'manufacturer_id',
'color_id',
'weight',
@@ -31,19 +31,19 @@ class Filament extends Model
// Filament belongs to a type
public function type()
{
return $this->hasOne(FilamentType::class);
return $this->belongsTo(FilamentType::class, 'filament_type_id');
}
// Filament belongs to a manufacturer
public function manufacturer()
{
return $this->hasOne(Manufacturer::class);
return $this->belongsTo(Manufacturer::class);
}
// Filament belongs to a color
public function color()
{
return $this->hasOne(Color::class);
return $this->belongsTo(Color::class);
}
}