solve payment issue

This commit is contained in:
jayvirsinh_gohil
2022-01-11 15:06:07 +05:30
parent dcb3ddecb9
commit bcd80377cf
2 changed files with 9 additions and 5 deletions

View File

@ -36,6 +36,11 @@ class PaymentMethod extends Model
return $this->belongsTo(Company::class);
}
public function scopeWhereCompanyId($query, $id)
{
$query->where('company_id', $id);
}
public function scopeWhereCompany($query)
{
$query->where('company_id', request()->header('company'));
@ -48,7 +53,7 @@ class PaymentMethod extends Model
public function scopeWhereSearch($query, $search)
{
$query->where('name', 'LIKE', '%' . $search . '%');
$query->where('name', 'LIKE', '%'.$search.'%');
}
public function scopeApplyFilters($query, array $filters)
@ -88,8 +93,7 @@ class PaymentMethod extends Model
public static function getSettings($id)
{
$settings = PaymentMethod::whereCompany()
->find($id)
$settings = PaymentMethod::find($id)
->settings;
return $settings;