ui updates for ticket layout now with multipel attachments
This commit is contained in:
@@ -108,6 +108,7 @@ final class TicketEdit extends Component
|
||||
|
||||
$this->validate();
|
||||
$this->validate([
|
||||
'attachments' => 'array',
|
||||
'attachments.*' => 'file|max:'.config('helpdesk.max_upload_kb', 10240).'|mimes:'.implode(',', config('helpdesk.allowed_mimes', ['jpg', 'jpeg', 'png', 'pdf', 'txt', 'log', 'zip'])),
|
||||
'tag_ids.*' => 'integer|exists:helpdesk_tags,id',
|
||||
]);
|
||||
@@ -274,8 +275,9 @@ final class TicketEdit extends Component
|
||||
continue;
|
||||
}
|
||||
|
||||
$path = $upload->store('helpdesk/tickets/'.$this->ticket->id, 'public');
|
||||
$this->ticket->attachments()->create($this->attachmentPayload($upload, $path));
|
||||
$disk = (string) config('helpdesk.disk', 'local');
|
||||
$path = $upload->store('tickets/'.$this->ticket->id, $disk);
|
||||
$this->ticket->attachments()->create($this->attachmentPayload($upload, $path, $disk));
|
||||
}
|
||||
|
||||
$this->attachments = [];
|
||||
@@ -287,14 +289,14 @@ final class TicketEdit extends Component
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
private function attachmentPayload(TemporaryUploadedFile $upload, string $path): array
|
||||
private function attachmentPayload(TemporaryUploadedFile $upload, string $path, string $disk): array
|
||||
{
|
||||
$table = 'helpdesk_attachments';
|
||||
$payload = [];
|
||||
$columns = [
|
||||
'user_id' => Auth::id(),
|
||||
'uploaded_by_id' => Auth::id(),
|
||||
'disk' => 'public',
|
||||
'disk' => $disk,
|
||||
'path' => $path,
|
||||
'file_path' => $path,
|
||||
'filename' => basename($path),
|
||||
|
||||
Reference in New Issue
Block a user