I would start with dd() to check the paths are all correct
$location = storage_path('app/public/dealers/' . Auth::id() . '/' . $filename);
dd($folder, $filename);
I can upload files and make directories from the first model i created. I have linked the sorage and the public folder.The uploading is working fine and i noticed my second controller creates the folder and then doesn't upload the image,instead making a linked folder which i cannot even open.
My not working storage path : $folder = storage_path('app/public/posts/' . Auth::id() . '/' );
if i change the directory to any other folder otherthan the public folder like app/dealers it works and uploads the images.I am guessing what could be the cause.I am using Image intervention library.
$image = $request->file('customFile');
$folder = storage_path('app/public/dealers/' . Auth::id() . '/' );
//$folder = storage_path('app/dealers/' . Auth::id() . '/' ); This works
$filename = 'logo' . '.' . $image->getClientOriginalExtension();
File::makeDirectory($folder, 0775, true, true);
$location = storage_path('app/public/dealers/' . Auth::id() . '/' . $filename);
Image::make($image)->save($location);
$dealer->logo = $filename;
$dealer->save();
$dealer->save();
I would start with dd() to check the paths are all correct
$location = storage_path('app/public/dealers/' . Auth::id() . '/' . $filename);
dd($folder, $filename);
Please or to participate in this conversation.