@mallory_cormier
To add files to disk on Laravel, you can follow these steps:
1 2 3 4 5 6 |
'disks' => [ 'my_disk' => [ 'driver' => 'local', 'root' => storage_path('app/my_disk'), ], ], |
1
|
Storage::disk('my_disk')->put('filename.txt', 'File contents'); |
You can also store a file from a form input or request like:
1
|
Storage::disk('my_disk')->put('filename.txt', $request->file('file')); |
1
|
$fileContents = Storage::disk('my_disk')->get('filename.txt'); |
By following these steps, you can easily add files to disk on Laravel and interact with them in your application.