krisell/cosmos-cache-driver
Composer 安装命令:
composer require krisell/cosmos-cache-driver
包简介
CosmosDB cache driver for Laravel
README 文档
README
This package adds support to use Microsoft Azure CosmosDB as a cache driver for your Laravel project. It uses the MongoDB-API, so make sure you configure that on the Azure end.
Prerequisities
Make sure you have a driver for the mongodb connection installed, for instance jenssegers/mongodb. Note that you also need to enable the pecl extension for mongodb.
Configuration
Add the following configurations
database.php
'cosmos' => [ 'driver' => 'mongodb', 'database' => env('COSMOS_DATABASE'), 'dsn' => env('COSMOS_CONNECTION'), ],
cache.php
'cosmos' => [ 'driver' => 'cosmos', 'table' => env('COSMOS_TABLE', 'cache_'.config('app.env')), ],
So, in your .env, add
COSMOS_DATABASE=database_name
COSMOS_CONNECTION=database_connection_string (something like mongodb://)
COSMOS_TABLE=table_name (optional, defaults to cache_{{env}})
The database and table are created automatically by CosmosDB.
统计信息
- 总下载量: 3.07k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-07-10