Skip to content

sausin/laravel-ovh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel OVH Object Storage driver

Latest Version on Packagist Build Status Quality Score StyleCI Total Downloads License: MIT

Laravel Storage facade provides support for many different filesystems.

This is a wrapper to combine others' work to integrate with laravel and provide support for OVH Object Storage.

Installing

Install via composer:

composer require sausin/laravel-ovh

Then include the service provider in config/app.php

Sausin\LaravelOvh\OVHServiceProvider::class

in the providers array

Define the ovh driver in the config/filesystems.php as below

        'ovh' => [
            'server' => env('OVH_URL'),
            'driver' => 'ovh',
            'user' => env('OVH_USER'),
            'pass' => env('OVH_PASS'),
            'region' => env('OVH_REGION'),
            'tenantName' => env('OVH_TENANT_NAME'),
            'container' => env('OVH_CONTAINER'),
            'projectId' => env('OVH_PROJECT_ID'),
            'urlKey' => env('OVH_URL_KEY'),
        ],

define the correct env variables above in your .env file and you should now have a working OVH Object Storage setup :)

Be sure to run

php artisan config:cache

again if you've been using the caching on your config file.

Usage

Refere to extensive laravel documentation for usage. Of note - this package includes support for the following additional methods:

Storage::url()

and

Storage::temporaryUrl()

The temporary url is relevant for private containers where files are not publicly accessible under normal conditions. This generates a temporary url with expiry (see details here for usage).

Note that this requires the container to have a proper header. The key in the header should match the urlKey specified in filesystems.php. For details on how to setup the header on your OVH container, see here.

Credits

Packages

No packages published

Contributors 6

Languages