thamibn's avatar

storage_path() file does not exist

i have uploaded file successfully on the storage/app/public/uploads, and created the symlink which created a storage/uploads in public folder when i execute the below function:

public function index() { $manuals = Manual::all();

    foreach($manuals as $manual){
        return response()->download(storage_path($manual->path_url));
    }
}

it returns the following error:

The file "E:\SCHOOL\Xampp\htdocs\vmg\vmg-laravel-api\storage\uploads\1548144844-Provincial Internship.pdf" does not exist

and the file does exist in the public folder storage/uploads and in the storage folder app/public/uploads.

storage_path() is not suppose to return E:\SCHOOL\Xampp\htdocs\vmg\vmg-laravel-api********\storage\uploads$Filename

Where ******* is supposed to be public

instead of E:\SCHOOL\Xampp\htdocs\vmg\vmg-laravel-api\storage\uploads$Filename

without the public

my filesystem:

    'public' => [
        'driver' => 'local',
        'root' => storage_path('app/public'),
        'url' => env('APP_URL').'/storage',
        'visibility' => 'public',
],
0 likes
2 replies
Sergiu17's avatar
dd(storage_path($name_Of_File));

Start debugging

thamibn's avatar

@SERGIU17 - i did debug i think i see the error but i cant fix it, the return path is: (E:\SCHOOL\Xampp\htdocs\vmg\vmg-laravel-api******\storage\uploads\1548144844-Provincial Internship.pdf) where ****** is supposed to be public. but is not?

Please or to participate in this conversation.