Refactor install wizard and mail configuration

This commit is contained in:
Darko Gjorgjijoski
2026-04-09 10:06:27 +02:00
parent 1d2cca5837
commit 9174254165
55 changed files with 3102 additions and 1162 deletions

View File

@@ -0,0 +1,36 @@
<?php
namespace App\Http\Requests;
use App\Services\MailConfigurationService;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class CompanyMailConfigurationRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*/
public function rules(): array
{
if ($this->string('use_custom_mail_config')->toString() !== 'YES') {
return [
'use_custom_mail_config' => ['required', 'string', Rule::in(['YES', 'NO'])],
'mail_driver' => ['nullable', 'string'],
];
}
return app(MailConfigurationService::class)->validationRules(
$this->string('mail_driver')->toString(),
true
);
}
}