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:
Darko Gjorgjijoski
2025-09-19 15:42:53 +02:00
committed by GitHub
parent 3da86965e1
commit 18d63a3375
24 changed files with 943 additions and 435 deletions

View File

@@ -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');
}
}