This is what i have done to upload my file into in laravel project.
if($request->file()) {
$fileName = time().'_'.$request->file('imageFile')->getClientOriginalName();
$filePath = $request->file('imageFile')->storeAs('products', $fileName, 'public');
$product->featured_image = '/storage/' . $filePath;
}
public disk
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
],
The file uploaded in storage folder inside app/public/products but when I try to retrieve my file showing 404 error. Even I have created the symbolic link with the public folder but not working. i don't no why but files are not showing inside the public folder. files are only uploading project level or private folder inside storage folder. how I can access the file through a web browser.