|
| 1 | +# Laravel kDrive Storage Driver |
| 2 | + |
| 3 | +[![Latest Version on Packagist][icon-version]][link-packagist] |
| 4 | +[![Software License][icon-license]](LICENSE.md) |
| 5 | +[![Total Downloads][icon-license]][link-packagist] |
| 6 | + |
| 7 | +This package contains an [Infomaniak kDrive](https://www.infomaniak.com/en/kdrive/) storage driver for Laravel. |
| 8 | + |
| 9 | +## Installation |
| 10 | +Via [Composer](https://getcomposer.org/) |
| 11 | +```shell script |
| 12 | +composer require infomaniak/laravel-kdrive |
| 13 | +``` |
| 14 | + |
| 15 | +### Register the Service Provider |
| 16 | +Starting with laravel 5.5, the Service Provider is automatically registered so may skip this instruction. |
| 17 | + |
| 18 | +Add the Service provider to your `config/app.php` file: |
| 19 | + |
| 20 | +```php |
| 21 | +'providers' => [ |
| 22 | + \Infomaniak\KDrive\KDriveServiceProvider::class, |
| 23 | +], |
| 24 | +``` |
| 25 | + |
| 26 | +### Configure a new disk |
| 27 | +Add a new disk to your `config/filesystems.php` file: |
| 28 | + |
| 29 | +```php |
| 30 | +'disks' => [ |
| 31 | + 'kdrive' => [ |
| 32 | + 'driver' => 'kdrive', |
| 33 | + 'id' => env('KDRIVE_ID'), |
| 34 | + 'username' => env('KDRIVE_USERNAME'), |
| 35 | + 'password' => env('KDRIVE_PASSWORD'), |
| 36 | + 'prefix' => env('KDRIVE_PREFIX', ''), |
| 37 | + ] |
| 38 | +], |
| 39 | +``` |
| 40 | + |
| 41 | +### Setup your .env file |
| 42 | +Add your credentials to your `.env` file. See [Credentials](#credentials) for more information on obtaining them. |
| 43 | + |
| 44 | +``` |
| 45 | +KDRIVE_ID=123456 |
| 46 | + |
| 47 | +KDRIVE_PASSWORD=******************** |
| 48 | +KDRIVE_PREFIX= |
| 49 | +``` |
| 50 | + |
| 51 | +The `KDRIVE_PREFIX` is optional an you may remove it from you `.env` file is you do not use it. This settings allows you to define another folder as your root. |
| 52 | + |
| 53 | +## Credentials |
| 54 | +To be able to connect to your kDrive, you'll need the following information. |
| 55 | + |
| 56 | +1. Your kDrive ID ([Find your kDrive ID](#find-your-kdrive-id)) |
| 57 | +2. Your login email address (the one you'd use on https://manager.infomaniak.com) |
| 58 | +3. A unique application password ([Generate an application password](https://manager.infomaniak.com/v3/profile/application-password)) |
| 59 | + |
| 60 | +### Find your kDrive ID |
| 61 | +1. Connect to your kDrive directly on Infomaniak |
| 62 | +2. Find your drive's ID in the URL : `https://drive.infomaniak.com/app/drive/[ID]/files` |
| 63 | + |
| 64 | +## License |
| 65 | +The MIT License (MIT). Please see the [LICENSE](LICENSE.md) for more information. |
| 66 | + |
| 67 | +[icon-version]: https://img.shields.io/packagist/v/infomaniak/laravel-kdrive?style=flat-square |
| 68 | +[icon-license]: https://img.shields.io/packagist/l/infomaniak/laravel-kdrive?style=flat-square |
| 69 | +[icon-downloads]: https://img.shields.io/packagist/dt/infomaniak/laravel-kdrive?style=flat-square |
| 70 | +[link-packagist]: https://packagist.org/packages/infomaniak/laravel-kdrive |
0 commit comments