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
22 lines
543 B
PHP
22 lines
543 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
namespace App\Models\Products;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
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');
|
|
}
|
|
}
|