Linode's Object Storage is marked as being S3 compatible. Knowing this I thought that I can simply use Linode's credentials in my filesystems.php and use ->disk('s3') to upload and download files but apparently this is not the case.
I have installed all required S3 PHP packages as suggested in Laravel's docs.
My .env has:
AWS_ACCESS_KEY_ID=foo
AWS_SECRET_ACCESS_KEY=bar
AWS_DEFAULT_REGION=DE
AWS_BUCKET=my-linode-storage-object.eu-central-1.linodeobjects.com
In logs I get exception to Could not resolve host. It tries to concatenate AWS endpoint with what I provided above so no-brainer that it doesn't work. Should I install completely different package to handle Linode's Storage Object connections?
I don't see much tutorials on the web on how to use Linode's Storage Object in Laravel apps. Any links or hints would be appreciated.
From the laravel docs just install one of the required Composer Packages
$ composer require league/flysystem-aws-s3-v3
Do not install league/flysystem-cached-adapter yet, since that would require more configuration.
Next, add a new disk that uses the s3 driver under the configuration filesytems file config/filesystems.php
'linode' => [
'driver' => 's3',
'key' => env('LINODE_KEY'),
'secret' => env('LINODE_SECRET'),
'endpoint' => env('LINODE_ENDPOINT'),
'region' => env('LINODE_REGION'),
'bucket' => env('LINODE_BUCKET'),
],
Add the new the environment variables to your project's .env file:
LINODE_KEY="KEYUNDERDOUBLEQUOTES"
LINODE_SECRET="SECRETUNDERDOUBLEQUOTES"
LINODE_ENDPOINT="https://eu-central-1.linodeobjects.com"
LINODE_REGION="eu-central-1"
LINODE_BUCKET="bucket-name"
I usually include the variables under "" to make sure it works with symbols. Also include http or https under LINODE_ENDPOINT.
Now that you have everything set up, you can now use this disk on your laravel code ->disk('linode')