Item tax model add item relation

This commit is contained in:
Cüneyt Şentürk 2020-12-21 11:14:12 +03:00
parent 2fb4352767
commit 669c05eaaa

View File

@ -18,6 +18,11 @@ class ItemTax extends Model
*/ */
protected $fillable = ['company_id', 'item_id', 'tax_id']; protected $fillable = ['company_id', 'item_id', 'tax_id'];
public function item()
{
return $this->belongsTo('App\Models\Common\Item')->withDefault(['name' => trans('general.na')]);
}
public function tax() public function tax()
{ {
return $this->belongsTo('App\Models\Setting\Tax')->withDefault(['name' => trans('general.na'), 'rate' => 0]); return $this->belongsTo('App\Models\Setting\Tax')->withDefault(['name' => trans('general.na'), 'rate' => 0]);