feat : Tag 모델 추가
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
|
||||
namespace App\Models\Materials;
|
||||
|
||||
use App\Models\File;
|
||||
use App\Models\Commons\File;
|
||||
use App\Models\Commons\Tag;
|
||||
use App\Models\Qualitys\Lot;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
@@ -35,8 +36,15 @@ public function lots()
|
||||
return $this->hasMany(Lot::class, 'material_id');
|
||||
}
|
||||
|
||||
// 파일 목록 (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