first commit

This commit is contained in:
Sampanna Rimal
2024-08-27 17:48:06 +05:45
commit 53c0140f58
10839 changed files with 1125847 additions and 0 deletions

View File

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

View File

@ -0,0 +1,36 @@
<?php
namespace Modules\Product\Models;
use App\Traits\StatusTrait;
use Illuminate\Database\Eloquent\Model;
use Modules\Supplier\Models\Supplier;
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');
}
public function warehouse()
{
return $this->belongsTo(Warehouse::class, 'warehouse_id');
}
public function supplier()
{
return $this->belongsTo(Supplier::class, 'supplier_id');
}
}

View File

@ -0,0 +1,11 @@
<?php
namespace Modules\Product\Models;
use Illuminate\Database\Eloquent\Model;
class ProductStock extends Model
{
protected $table = 'tbl_product_stocks';
protected $guarded = [];
}

View File

@ -0,0 +1,21 @@
<?php
namespace Modules\Product\Models;
use App\Traits\StatusTrait;
use Illuminate\Database\Eloquent\Model;
class SubCategory extends Model
{
USE StatusTrait;
protected $table = 'tbl_sub_categories';
protected $guarded = [];
protected $appends = ['status_name'];
public function category()
{
return $this->belongsTo(Category::class, 'category_id');
}
}

View File

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