ssdb for laravel
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
README.md
composer.json

README.md

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/cache.php
    'stores' => [
        'ssdb' => [
            'driver'  => 'ssdb',
            'host'    => '127.0.0.1',
            'port'    => 8888,
            'timeout' => 2000,
        ],
        // ...
    ]

Usage

As Facades

use Huangdijia\Ssdb\Facades\Ssdb;

...
    Ssdb::set('key', 'value');
    $value = Ssdb::get('key');

As Helper

ssdb()->set('key');
ssdb()->get('key');

As Cache Store Driver

// config/cache.php
    'default' => 'ssdb',

or

set .env as

CACHE_DRIVER=ssdb

As Session Manager

// config/session.php
    'driver' => 'ssdb',

or

set .env as

SESSION_DRIVER=ssdb

Other

SSDB PHP API

http://ssdb.io/docs/zh_cn/php/index.html

License

laravel-ssdb is licensed under The MIT License (MIT).