Dealing with files
Laravel 5 includes the excellent Flysystem project for interacting with files both in the application filesystem, as well as popular cloud-based storage solutions such as Amazon Simple Storage Service (Amazon S3) and Rackspace. Filesystems are configured as disks in the config/filesystems.php
file. You can then use a consistent API to manage files, whether they are located locally or in an external cloud store.
Calling methods directly on the Storage
façade will call those methods on the default disk as follows:
Storage::exists('foo.txt');
You can also explicitly specify the disk to perform actions on, in case you have more than one disk configured, as follows:
Storage::disk('local')->exists('foo.txt');
You can read and write data to files as follows:
Storage::put('foo.txt', $contents); $contents = Storage::get('foo.txt');
You can also prepend or append data instead as follows:
Storage::prepend('foo.txt', &apos...