email support

This commit is contained in:
Simon Pocrnjič
2025-10-11 17:20:05 +02:00
parent 7c7defb6c5
commit 1b615163be
23 changed files with 3183 additions and 28 deletions
@@ -0,0 +1,27 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class StoreEmailTemplateRequest extends FormRequest
{
public function authorize(): bool
{
return $this->user()?->can('create', \App\Models\EmailTemplate::class) ?? false;
}
public function rules(): array
{
return [
'name' => ['required', 'string', 'max:255'],
'key' => ['required', 'string', 'max:255', 'unique:email_templates,key'],
'subject_template' => ['required', 'string', 'max:1000'],
'html_template' => ['nullable', 'string'],
'text_template' => ['nullable', 'string'],
'entity_types' => ['nullable', 'array'],
'entity_types.*' => ['string', 'in:client,client_case,contract,person'],
'active' => ['boolean'],
];
}
}