This commit is contained in:
Sampanna Rimal
2024-09-11 12:32:15 +05:45
parent 82fab174dc
commit afb2c202d6
170 changed files with 3352 additions and 363 deletions

View File

@ -0,0 +1,16 @@
<?php
namespace Modules\Product\Models;
use App\Traits\StatusTrait;
use Illuminate\Database\Eloquent\Model;
class FabricCategory extends Model
{
USE StatusTrait;
protected $table = 'tbl_fabriccategories';
protected $guarded = [];
protected $appends = ['status_name'];
}

View File

@ -6,6 +6,7 @@ use App\Traits\StatusTrait;
use Illuminate\Database\Eloquent\Model;
use Modules\Supplier\Models\Supplier;
class Product extends Model
{
USE StatusTrait;
@ -25,10 +26,16 @@ class Product extends Model
return $this->belongsTo(SubCategory::class, 'sub_category_id');
}
public function fabricCategory()
{
return $this->belongsTo(FabricCategory::class, 'fabriccategory_id');
}
public function warehouse()
{
return $this->belongsTo(Warehouse::class, 'warehouse_id');
}
public function supplier()
{
return $this->belongsTo(Supplier::class, 'supplier_id');