feat : Tag 모델 추가
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user