akaunting 3.0 (the last dance)
This commit is contained in:
@ -20,8 +20,19 @@ class Transaction extends FormRequest
|
||||
$attachment = 'mimes:' . config('filesystems.mimes') . '|between:0,' . config('filesystems.max_size') * 1024;
|
||||
}
|
||||
|
||||
// Check if store or update
|
||||
if ($this->getMethod() == 'PATCH') {
|
||||
$id = $this->transaction->getAttribute('id');
|
||||
} else {
|
||||
$id = null;
|
||||
}
|
||||
|
||||
// Get company id
|
||||
$company_id = (int) $this->request->get('company_id');
|
||||
|
||||
return [
|
||||
'type' => 'required|string',
|
||||
'number' => 'required|string|unique:transactions,NULL,' . $id . ',id,company_id,' . $company_id . ',deleted_at,NULL',
|
||||
'account_id' => 'required|integer',
|
||||
'paid_at' => 'required|date_format:Y-m-d H:i:s',
|
||||
'amount' => 'required|amount',
|
||||
|
Reference in New Issue
Block a user