mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-08 14:04:50 +00:00
Configurations cleanup & database configurations for mail and pdfs (#479)
* Move Mail, PDF configuration to Database, standardize configurations * Set default currency to USD on install * Pint code
This commit is contained in:
committed by
GitHub
parent
3da86965e1
commit
18d63a3375
@@ -27,7 +27,6 @@ class PDFConfigurationRequest extends FormRequest
|
||||
'string',
|
||||
],
|
||||
];
|
||||
break;
|
||||
|
||||
case 'gotenberg':
|
||||
return [
|
||||
@@ -40,18 +39,28 @@ class PDFConfigurationRequest extends FormRequest
|
||||
'url',
|
||||
],
|
||||
'gotenberg_papersize' => [
|
||||
'required',
|
||||
'string',
|
||||
function ($attribute, $value, $fail) {
|
||||
($attribute); // unused
|
||||
$reg = "/^\d+(pt|px|pc|mm|cm|in) \d+(pt|px|pc|mm|cm|in)$/";
|
||||
if (! preg_match($reg, $value)) {
|
||||
$fail('Invalid papersize, must be in format "210mm 297mm". Accepts: pt,px,pc,mm,cm,in');
|
||||
}
|
||||
},
|
||||
],
|
||||
'gotenberg_margins' => [
|
||||
'nullable',
|
||||
'string',
|
||||
],
|
||||
];
|
||||
|
||||
break;
|
||||
default:
|
||||
return [
|
||||
'pdf_driver' => [
|
||||
'required',
|
||||
'string',
|
||||
],
|
||||
];
|
||||
}
|
||||
throw new \InvalidArgumentException('Invalid PDFDriver requested');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user