34 lines
933 B
PHP
34 lines
933 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Offer;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class SendOfferRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return $this->user() !== null;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'subject' => 'required|string|max:500',
|
|
'body' => 'required|string|max:100000',
|
|
'cc' => 'nullable|string|max:2000',
|
|
'bcc' => 'nullable|string|max:2000',
|
|
'reply_to' => 'nullable|email|max:255',
|
|
'expires_at' => 'nullable|date|after:now',
|
|
];
|
|
}
|
|
|
|
public function messages(): array
|
|
{
|
|
return [
|
|
'subject.required' => 'Bitte einen Betreff angeben.',
|
|
'body.required' => 'Bitte den E-Mail-Text angeben.',
|
|
'expires_at.after' => 'Ablaufdatum muss in der Zukunft liegen.',
|
|
];
|
|
}
|
|
}
|