Implemented the authenticated admin contact system.
This commit is contained in:
29
app/Http/Requests/StoreSupportConversationRequest.php
Normal file
29
app/Http/Requests/StoreSupportConversationRequest.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Models\SupportConversation;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class StoreSupportConversationRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return $this->user() !== null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, mixed>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'category' => ['required', 'string', Rule::in(SupportConversation::categories())],
|
||||
'subject' => ['required', 'string', 'max:120'],
|
||||
'body' => ['required', 'string', 'max:2000'],
|
||||
'attachments' => ['nullable', 'array', 'max:3'],
|
||||
'attachments.*' => ['file', 'max:10240', 'mimes:jpg,jpeg,png,webp,gif,pdf,txt,log,json,zip'],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user