StocksNew/Modules/Product/app/Models/Product.php

44 lines
891 B
PHP
Raw Normal View History

2024-08-27 12:03:06 +00:00
<?php
namespace Modules\Product\Models;
use App\Traits\StatusTrait;
use Illuminate\Database\Eloquent\Model;
use Modules\Supplier\Models\Supplier;
2024-09-11 06:47:15 +00:00
2024-08-27 12:03:06 +00:00
class Product extends Model
{
USE StatusTrait;
protected $table = 'tbl_products';
protected $guarded = [];
protected $appends = ['status_name'];
public function category()
{
return $this->belongsTo(Category::class, 'category_id');
}
public function subCategory()
{
return $this->belongsTo(SubCategory::class, 'sub_category_id');
}
2024-09-11 06:47:15 +00:00
public function fabricCategory()
{
return $this->belongsTo(FabricCategory::class, 'fabriccategory_id');
}
2024-08-27 12:03:06 +00:00
public function warehouse()
{
return $this->belongsTo(Warehouse::class, 'warehouse_id');
}
2024-09-11 06:47:15 +00:00
2024-08-27 12:03:06 +00:00
public function supplier()
{
return $this->belongsTo(Supplier::class, 'supplier_id');
}
}