mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 19:51:09 -04:00
solve payment issue
This commit is contained in:
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user