Implemented the authenticated admin contact system.
This commit is contained in:
25
app/Http/Requests/StoreSupportMessageRequest.php
Normal file
25
app/Http/Requests/StoreSupportMessageRequest.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreSupportMessageRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return $this->user() !== null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, string>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'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