Complete the code to create a symbolic link for the public disk in Laravel.
php artisan storage:[1]In Laravel, the command php artisan storage:link creates a symbolic link from public/storage to storage/app/public.
Complete the code to define the public disk in Laravel's config/filesystems.php.
'public' => [ 'driver' => 'local', 'root' => storage_path('app/[1]'), 'url' => env('APP_URL').'/storage', 'visibility' => 'public', ],
The public disk points to the storage/app/public directory, so the root is set to storage_path('app/public').
Fix the error in the code to store a file on the public disk.
Storage::disk('[1]')->put('example.txt', 'Hello World');
To store files accessible publicly, use the 'public' disk, which points to the linked storage folder.
Fill both blanks to generate a URL for a file stored on the public disk.
$url = Storage::disk('[1]')->[2]('example.txt');
Use Storage::disk('public')->url('filename') to get the public URL of a stored file.
Fill all three blanks to check if a file exists on the public disk and delete it if it does.
if (Storage::disk('[1]')->[2]('example.txt')) { Storage::disk('[3]')->delete('example.txt'); }
Use exists to check if the file is present on the public disk, then delete it from the same disk.