akaunting 3.0 (the last dance)

This commit is contained in:
Burak Civan
2022-06-01 10:15:55 +03:00
parent cead09f6d4
commit d9c0764572
3812 changed files with 126831 additions and 102949 deletions

View File

@ -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',