feat : 자재관리, 수입관리, 로트관리 모델링 추가
This commit is contained in:
35
app/Models/Material.php
Normal file
35
app/Models/Material.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class Material extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
// 자재(품목) 마스터
|
||||
protected $fillable = [
|
||||
'name', // 자재명(품명)
|
||||
'specification', // 규격
|
||||
'material_code', // 자재코드
|
||||
'unit', // 단위
|
||||
'is_inspection', // 검사대상 여부(Y/N)
|
||||
'search_tag', // 검색 태그
|
||||
'remarks', // 비고
|
||||
];
|
||||
|
||||
|
||||
// 자재 입고 내역
|
||||
public function receipts()
|
||||
{
|
||||
return $this->hasMany(MaterialReceipt::class, 'material_id');
|
||||
}
|
||||
|
||||
// 로트 관리
|
||||
public function lots()
|
||||
{
|
||||
return $this->hasMany(Lot::class, 'material_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user