How to get the full file path in laravel?

Member

by jerad , in category: PHP Frameworks , 14 days ago

How to get the full file path in laravel?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by lily , 13 days 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.