How to get the full file path in laravel?

Member

by jerad , in category: PHP Frameworks , 6 months ago

How to get the full file path in laravel?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by lily , 6 months ago

@jerad 

In Laravel, you can get the full file path using the path() method provided by the Storage facade. Here's an example:

1
2
3
use IlluminateSupportFacadesStorage;

$filePath = Storage::path('file.txt');


This will return the full file path for the file file.txt located within your storage directory. You can replace 'file.txt' with the path to your desired file.