Complete the code to get the contents of a file stored in Laravel's storage.
use Illuminate\Support\Facades\Storage; $content = Storage::[1]('example.txt');
The get method retrieves the contents of the file from storage.
Complete the code to check if a file exists in Laravel's storage.
use Illuminate\Support\Facades\Storage; if (Storage::[1]('photo.jpg')) { // File exists }
The exists method returns true if the file is present in storage.
Fix the error in the code to retrieve a file's URL from Laravel storage.
use Illuminate\Support\Facades\Storage; $url = Storage::[1]('documents/report.pdf');
The url method returns the public URL for the stored file.
Fill both blanks to retrieve a file's size and check if it exists in Laravel storage.
use Illuminate\Support\Facades\Storage; if (Storage::[1]('image.png')) { $size = Storage::[2]('image.png'); }
First, exists checks if the file is there. Then, size gets the file size in bytes.
Fill all three blanks to retrieve the file's last modified time, check if it exists, and get its URL in Laravel storage.
use Illuminate\Support\Facades\Storage; if (Storage::[1]('video.mp4')) { $time = Storage::[2]('video.mp4'); $link = Storage::[3]('video.mp4'); }
First, exists checks if the file is there. Then, lastModified gets the last update time. Finally, url returns the public URL.