changes
This commit is contained in:
0
Modules/Stock/app/Models/.gitkeep
Normal file
0
Modules/Stock/app/Models/.gitkeep
Normal file
27
Modules/Stock/app/Models/Stock.php
Normal file
27
Modules/Stock/app/Models/Stock.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Stock\Models;
|
||||
|
||||
use App\Traits\StatusTrait;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Modules\Product\Models\Product;
|
||||
|
||||
class Stock extends Model
|
||||
{
|
||||
use StatusTrait;
|
||||
|
||||
protected $table = 'tbl_stocks';
|
||||
protected $guarded = [];
|
||||
protected $appends = ['status_name'];
|
||||
|
||||
public function stockLocation()
|
||||
{
|
||||
return $this->belongsTo(StockLocation::class, 'stocklocation_id');
|
||||
}
|
||||
|
||||
public function product()
|
||||
{
|
||||
return $this->belongsTo(Product::class, 'product_id');
|
||||
}
|
||||
}
|
||||
|
16
Modules/Stock/app/Models/StockLocation.php
Normal file
16
Modules/Stock/app/Models/StockLocation.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Stock\Models;
|
||||
|
||||
use App\Traits\StatusTrait;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class StockLocation extends Model
|
||||
{
|
||||
USE StatusTrait;
|
||||
|
||||
protected $table = 'tbl_stocklocations';
|
||||
protected $guarded = [];
|
||||
protected $appends = ['status_name'];
|
||||
|
||||
}
|
Reference in New Issue
Block a user