huangdijia / laravel-ssdb
ssdb for laravel
Installs: 1 348
Dependents: 0
Suggesters: 0
Security: 0
Stars: 16
Watchers: 3
Forks: 6
Open Issues: 0
Requires
- php: >=7.0.0
- illuminate/contracts: ^5.5|^6.0|^7.0|^8.0
- illuminate/support: ^5.5|^6.0|^7.0|^8.0
Requires (Dev)
- mockery/mockery: ^1.0
- orchestra/testbench: ^4.0
- phpunit/phpunit: ^6.0|^7.0|^8.0|^9.0
README
Requirements
- PHP >= 7.0
- Laravel >= 5.5
Installation
First, install laravel 5.5, and make sure that the database connection settings are correct.
composer require huangdijia/laravel-ssdb
Configurations
// config/database.php 'ssdb' => [ 'default' => 'default', 'connections' => [ 'default' => [ 'host' => env('SSDB_HOST', '127.0.0.1'), 'port' => env('SSDB_PORT', 8888), 'timeout' => env('SSDB_TIMEOUT', 2000), 'password' => 'your-password', // optional ], ], // ... ],
Usage
Connection
$ssdb = Ssdb::connection('default');
As Facades
use Huangdijia\Ssdb\Facades\Ssdb; ... Ssdb::set('key', 'value'); $value = Ssdb::get('key');
As Helper
ssdb()->set('key', 'value'); ssdb()->get('key');
As Cache Store Driver
// config/cache.php 'default' => 'ssdb', 'ssdb' => [ 'driver' => 'ssdb', 'connection' => 'default', ],
or
set .env as
CACHE_DRIVER=ssdb
As Session Manager
// config/session.php 'driver' => 'ssdb',
or
set .env as
SESSION_DRIVER=ssdb
Other
License
laravel-ssdb is licensed under The MIT License (MIT).