Files
FilamentLaravel/app/Models/Color.php
T
2025-03-10 19:37:44 +01:00

32 lines
518 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Color extends Model
{
// Color Model
protected $table = 'colors';
protected $primaryKey = 'id';
protected $fillable = [
'name',
'hex'
];
// Color has many filaments
public function filaments()
{
return $this->hasMany(Filament::class);
}
// Color has many filament types
public function filamentTypes()
{
return $this->hasMany(FilamentType::class);
}
}