Been trying tons of things to save a file upload into the proper directory in Laravel. I have the following in my controller. The $files and $folder variables are correct. Th
you should try this code. error in your storage::disk
line. write driver instead of drivers.
$files = $request->file('current_plan_year_claims_data_file_1');
$folder = public_path(). "\storage\\$id";
if (!File::exists($folder)) {
File::makeDirectory($folder, 0775, true, true);
}
if (!empty($files)) {
foreach($files as $file) {
Storage::disk(['driver' => 'local', 'root' => $folder])->put($file->getClientOriginalName(), file_get_contents($file));
}
}