restaurant changes
This commit is contained in:
42
Modules/PurchaseEntry/app/Models/PurchaseEntry.php
Normal file
42
Modules/PurchaseEntry/app/Models/PurchaseEntry.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\PurchaseEntry\Models;
|
||||
|
||||
use App\Traits\StatusTrait;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Modules\Customer\Models\Customer;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Modules\PurchaseEntry\Models\PurchaseEntryDetail;
|
||||
use Modules\Supplier\Models\Supplier;
|
||||
|
||||
class PurchaseEntry extends Model
|
||||
{
|
||||
USE StatusTrait;
|
||||
|
||||
protected $table = 'tbl_purchaseentries';
|
||||
protected $fillable = [
|
||||
'supplier_id',
|
||||
'purchase_date',
|
||||
'payment',
|
||||
'paymentmode_id',
|
||||
'paymentref',
|
||||
'total_amt',
|
||||
'created_at',
|
||||
'updated_at'
|
||||
];
|
||||
protected $appends = ['status_name'];
|
||||
|
||||
|
||||
public function purchaseEntryDetails():HasMany{
|
||||
return $this->hasMany(PurchaseEntryDetail::class,'purchaseentry_id');
|
||||
}
|
||||
|
||||
public function supplier():BelongsTo{
|
||||
return $this->belongsTo(Supplier::class);
|
||||
}
|
||||
|
||||
public static function getFillableField(){
|
||||
return (new self())->fillable;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user