mirror of
https://github.com/dyzulk/trustlab-api.git
synced 2026-01-26 13:22:05 +07:00
feat: organize ticket attachments by user id
This commit is contained in:
@@ -82,7 +82,7 @@ class TicketController extends Controller
|
|||||||
// Handle Attachments
|
// Handle Attachments
|
||||||
if ($request->hasFile('attachments')) {
|
if ($request->hasFile('attachments')) {
|
||||||
foreach ($request->file('attachments') as $file) {
|
foreach ($request->file('attachments') as $file) {
|
||||||
$path = $file->store('ticket-attachments', 'r2-private');
|
$path = $file->store("ticket-attachments/{$user->id}", 'r2-private');
|
||||||
// $url = Storage::disk('r2')->url($path); // Removed public URL generation
|
// $url = Storage::disk('r2')->url($path); // Removed public URL generation
|
||||||
TicketAttachment::create([
|
TicketAttachment::create([
|
||||||
'ticket_reply_id' => $reply->id,
|
'ticket_reply_id' => $reply->id,
|
||||||
@@ -170,7 +170,7 @@ class TicketController extends Controller
|
|||||||
// Handle Attachments
|
// Handle Attachments
|
||||||
if ($request->hasFile('attachments')) {
|
if ($request->hasFile('attachments')) {
|
||||||
foreach ($request->file('attachments') as $file) {
|
foreach ($request->file('attachments') as $file) {
|
||||||
$path = $file->store('ticket-attachments', 'r2-private');
|
$path = $file->store("ticket-attachments/{$user->id}", 'r2-private');
|
||||||
// $url = Storage::disk('r2')->url($path);
|
// $url = Storage::disk('r2')->url($path);
|
||||||
TicketAttachment::create([
|
TicketAttachment::create([
|
||||||
'ticket_reply_id' => $reply->id,
|
'ticket_reply_id' => $reply->id,
|
||||||
|
|||||||
Reference in New Issue
Block a user