I want the uploaded file to be located in the public/uploads
folder directly like public/uploads/my_file.jpeg
. Why is it that my code uploads it to public/uploads/file_name/file.jpeg
?
here is the filesystems.php
.
'public_uploads' => [
'driver' => 'local',
'root' => public_path() . '/uploads',
],
and here is the controller.
function upload_template(Request $request)
{
$filee = $request->file('file_upload');
$file_ext = $filee->extension();
$file_name = $model->id . "." . $file_ext;
Storage::disk('public_uploads')->put($file_name, $filee);
}