Skip to content

Commit ab3812b

Browse files
committed
Updated naming format
For exported files
1 parent 9ed5dac commit ab3812b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

app/Http/Controllers/UserController.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,9 @@ public function exportLinks(request $request)
755755

756756
$userData['links'] = $links->toArray();
757757

758-
$fileName = 'links.json';
758+
$domain = $_SERVER['HTTP_HOST'];
759+
$date = date('Y-m-d_H-i-s');
760+
$fileName = "links-$domain-$date.json";
759761
$headers = [
760762
'Content-Type' => 'application/json',
761763
'Content-Disposition' => 'attachment; filename="'.$fileName.'"',
@@ -780,7 +782,9 @@ public function exportAll(request $request)
780782
$userData = $user->toArray();
781783
$userData['links'] = $links->toArray();
782784

783-
$fileName = 'user_data.json';
785+
$domain = $_SERVER['HTTP_HOST'];
786+
$date = date('Y-m-d_H-i-s');
787+
$fileName = "user_data-$domain-$date.json";
784788
$headers = [
785789
'Content-Type' => 'application/json',
786790
'Content-Disposition' => 'attachment; filename="'.$fileName.'"',

0 commit comments

Comments
 (0)