I have created a function which stores file path in database and stores the file in public/uploads/release folder. Here is my Controller:
$reference = $request->get('reference');
$uploads = array();
if($files = $request->file('uploads'))
{
foreach ($files as $file) {
$name = $file->getClientOriginalName();
$file->move('uploads/release', $name);
$uploads[] = $name;
}
Here I am storing file in public/uploads/release folder, but now I want to create a folder dynamically every time a file is uploaded, and the folder must be the value from the $reference variable. e.g: reference is 'ABC123'. Then the file must be automatically stored in public/uploads/release/ABC123 folder.