mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 19:51:09 -04:00
v5.0.0 update
This commit is contained in:
@ -27,14 +27,17 @@ class PaymentMethodRequest extends FormRequest
|
||||
$data = [
|
||||
'name' => [
|
||||
'required',
|
||||
'unique:payment_methods,name',
|
||||
Rule::unique('payment_methods')
|
||||
->where('company_id', $this->header('company')),
|
||||
],
|
||||
];
|
||||
|
||||
if ($this->getMethod() == 'PUT') {
|
||||
$data['name'] = [
|
||||
'required',
|
||||
Rule::unique('payment_methods')->ignore($this->route('payment_method'), 'id'),
|
||||
Rule::unique('payment_methods')
|
||||
->ignore($this->route('payment_method'), 'id')
|
||||
->where('company_id', $this->header('company')),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user