PHP code example of ebethus / laravel-s3-cache-driver
1. Go to this page and download the library: Download ebethus/laravel-s3-cache-driver library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ebethus / laravel-s3-cache-driver example snippets
/*
* Package Service Providers...
*/
Imannms\LaravelS3CacheDriver\S3CacheServiceProvider::class,
'stores' => [
// other stores
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
'path' => env('AWS_PATH', 'cache'), // cache root directory, you can change it to suit your need
],
]
'stores' => [
// other stores
'do_spaces' => [
'driver' => 's3',
'key' => env('DO_SPACES_KEY'),
'secret' => env('DO_SPACES_SECRET'),
'region' => env('DO_SPACES_REGION'),
'bucket' => env('DO_SPACES_BUCKET'),
'endpoint' => env('DO_SPACES_ENDPOINT'),
'path' => env('DO_SPACES_PATH', 'cache'), // cache root directory, you can change it to suit your need
],
]
use Cache;
Cache::store('s3')->put('key', 'value', 60*5);
Cache::store('s3')->get('key');
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.