From ab3812b5a01347c6fee60c9f25fd6a8fe800042f Mon Sep 17 00:00:00 2001 From: Julian Prieber Date: Wed, 8 Mar 2023 18:01:23 +0100 Subject: [PATCH] Updated naming format For exported files --- app/Http/Controllers/UserController.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index df34906..d8fd8bb 100755 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -755,7 +755,9 @@ class UserController extends Controller $userData['links'] = $links->toArray(); - $fileName = 'links.json'; + $domain = $_SERVER['HTTP_HOST']; + $date = date('Y-m-d_H-i-s'); + $fileName = "links-$domain-$date.json"; $headers = [ 'Content-Type' => 'application/json', 'Content-Disposition' => 'attachment; filename="'.$fileName.'"', @@ -780,7 +782,9 @@ class UserController extends Controller $userData = $user->toArray(); $userData['links'] = $links->toArray(); - $fileName = 'user_data.json'; + $domain = $_SERVER['HTTP_HOST']; + $date = date('Y-m-d_H-i-s'); + $fileName = "user_data-$domain-$date.json"; $headers = [ 'Content-Type' => 'application/json', 'Content-Disposition' => 'attachment; filename="'.$fileName.'"',