email support
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateEmailTemplateRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return $this->user()?->can('update', $this->route('emailTemplate')) ?? false;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
$id = $this->route('emailTemplate')?->id;
|
||||
|
||||
return [
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'key' => ['required', 'string', 'max:255', 'unique:email_templates,key,'.$id],
|
||||
'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'],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user