feat : 테이블 및 DB 마이그레이션 파일 추가
products - common_codes - parts - products - files - price_histories - boms - bom_items boards - boards - board_settings - posts - board_comments - board_files - post_custom_field_values permissions - menus - roles - user_menu_permissions - role_menu_permissions tenants - tenants - plans - subscriptions - payments
This commit is contained in:
25
app/Models/Products/Bom.php
Normal file
25
app/Models/Products/Bom.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Products;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class Bom extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
protected $fillable = ['tenant_id','product_id','code','name','category_id','attributes','description','is_default','is_active','image_file_id'];
|
||||
|
||||
public function product() {
|
||||
return $this->belongsTo(Product::class);
|
||||
}
|
||||
public function category() {
|
||||
return $this->belongsTo(CommonCode::class, 'category_id');
|
||||
}
|
||||
public function items() {
|
||||
return $this->hasMany(BomItem::class);
|
||||
}
|
||||
public function image() {
|
||||
return $this->belongsTo(File::class, 'image_file_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user