StocksNew/Modules/PurchaseEntry/app/Models/PurchaseEntryDetail.php
2024-09-19 18:33:08 +05:45

40 lines
841 B
PHP

<?php
namespace Modules\PurchaseEntry\Models;
use App\Traits\StatusTrait;
use Illuminate\Database\Eloquent\Model;
use Modules\PurchaseEntry\Models\PurchaseEntry;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Modules\Supplier\Models\Supplier;
class PurchaseEntryDetail extends Model
{
USE StatusTrait;
protected $table = 'tbl_purchaseentrydetails';
protected $fillable = [
'purchaseentry_id',
'product_id',
'category_id',
'stock_id',
'size_id',
'unit',
'price',
'rate',
'quantity',
'amount',
'desc',
'created_at',
'updated_at'
];
protected $appends = ['status_name'];
public function order(): BelongsTo
{
return $this->belongsTo(PurchaseEntry::class);
}
}