feat : Tag 모델 추가

This commit is contained in:
2025-07-29 17:20:44 +09:00
parent 33312e7a74
commit 24c85a0605
7 changed files with 101 additions and 7 deletions

View File

@@ -2,6 +2,8 @@
namespace App\Models\Products;
use App\Models\Commons\File;
use App\Models\Commons\Tag;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
@@ -17,8 +19,15 @@ public function boms() {
return $this->hasMany(Bom::class);
}
// 파일 목록 (N:M, 폴리모픽)
public function files()
{
return $this->morphMany(File::class, 'fileable');
}
// 태그 목록 (N:M, 폴리모픽)
public function tags()
{
return $this->morphToMany(Tag::class, 'taggable');
}
}