└── README.md /README.md: -------------------------------------------------------------------------------- 1 | # Yandex Object Storage for Laravel 2 | Adding configuration for working with Yandex cloud storage to Laravel 3 | 4 | ## Usage 5 | 6 | To work with Yandex Object Storage, you need to add a package using the Composer: 7 | 8 | ``` 9 | composer require league/flysystem-aws-s3-v3 ~1.0 10 | ``` 11 | 12 | Add the following code to your config/filesystems.php 13 | 14 | ``` 15 | 'yandexcloud' => [ 16 | 'driver' => 's3', 17 | 'key' => 'your_key', 18 | 'secret' => 'your_secret_key', 19 | 'endpoint' => 'http://storage.yandexcloud.net/', 20 | 'region' => 'us-west-2', 21 | 'bucket' => 'static.example.com', 22 | 'url' => 'http://static.example.com/', 23 | ], 24 | ``` 25 | 26 | And then you can use 27 | 28 | ``` 29 | $disk = Storage::disk('yandexcloud'); 30 | ``` 31 | 32 | to get your yandex cloud storage instance 33 | 34 | ## How to check? 35 | ``` 36 | php artisan tinker 37 | ``` 38 | 39 | ``` 40 | Storage::disk('yandexcloud')->put('hello.txt', 'check text'); 41 | Storage::disk('yandexcloud')->files(); 42 | Storage::disk('yandexcloud')->url('hello.txt'); 43 | ``` 44 | ## Cloud documentation 45 | https://cloud.yandex.ru/docs/storage/quickstart 46 | --------------------------------------------------------------------------------