How can I get the storage path in Laravel 8

By | June 4, 2021

You might be creating a script in Laravel, that can help you to get the storage path of a file/image. Which you have already stored in the ‘storage/app/images‘ directory (For example). And, you want to get the file from the storage path to process further.

Laravel has already created a plenty of helper methods, by using them you can get absolute/relative paths easily.

To get the absolute of the image, you can use following helper method.

$file_path = storage_path('app/images/myimage.png');

When you execute above code, you will get the fully qualified path to myimage.png file.