Don't use timestamps with multi-image uploads.
I'm pretty sure all programmers have had to write code to upload an image at some point, and I'm pretty sure most of you have used a timestamp as the image name.

Don't use timestamps
$names = collect([
'0' => 'Jonathon',
'1' => 'Justin',
'2' => 'Sally',
'3' => 'Sally',
]);
$testArray = [];
foreach ($names as $name) {
$testArray[] = $name . '-' . time();
}
dd($testArray);
$results = array:3 [▼
0 => "Jonathon-1636344452"
1 => "Justin-1636344452"
2 => "Sally-1636344452"
3 => "Sally-1636344452"
];Whats the solution?
$names = collect([
'0' => 'Jonathon',
'1' => 'Justin',
'2' => 'Sally',
'3' => 'Sally',
]);
$testArray = [];
foreach ($names as $name) {
$testArray[] = $name . '-' . Str::random(8);
}
dd($testArray);
$results = array:4 [▼
0 => "Jonathon-SeTNhsmL"
1 => "Justin-2sjRUxg8"
2 => "Sally-Laytdn5m"
3 => "Sally-6cUDA5Cd"
]