feat: 계좌관리 추가
This commit is contained in:
33
app/Models/Products/Part.php
Normal file
33
app/Models/Products/Part.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Products;
|
||||
|
||||
use App\Models\Commons\Tag;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
/**
|
||||
* @mixin IdeHelperPart
|
||||
*/
|
||||
class Part extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $fillable = ['tenant_id', 'code', 'name', 'category_id', 'part_type_id', 'unit', 'attributes', 'description', 'is_active'];
|
||||
|
||||
public function category()
|
||||
{
|
||||
return $this->belongsTo(CommonCode::class, 'category_id');
|
||||
}
|
||||
|
||||
public function partType()
|
||||
{
|
||||
return $this->belongsTo(CommonCode::class, 'part_type_id');
|
||||
}
|
||||
|
||||
// 태그 목록 (N:M, 폴리모픽)
|
||||
public function tags()
|
||||
{
|
||||
return $this->morphToMany(Tag::class, 'taggable');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user