New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

bebbolus/elasticsessions

ElasticSearch Sessions Driver for Laravel PHP Framework
54 1
Install
composer require bebbolus/elasticsessions:dev-master
PHP:>=5.6.4
License:MIT
Last Updated:Apr 13, 2017
Links: GitHub  ·  Packagist
Maintainer: bebbolus

ElasticSessions

a package to provide a ElasticSearch Sessions Driver for Laravel PHP Framework

Requirements

ElasticSessions is born on top of Elastiquent, you must be running at least Elasticsearch 1.0. Elasticsearch 0.9 and below will not work and are not supported.

You need to set-up your own Index and Type for sessions and configure it in .env (ELS_INDEX_USER, ELS_TYPE_SESSION)

Set up

To begin configuration, first update the composer.json with the relative requirement and autoload sections:

Require section for our custom package and third party libraries:

...
"require": {
    ...
    "elasticquent/elasticquent": "dev-master",
    "bebbolus/elasticsessions": "dev-master"
},
...

Now add the following code on App\Config\App.php

add app providers:

'providers' => [
    ...
    Elasticquent\ElasticquentServiceProvider::class,
    ElasticSessions\ElasticSessionsServiceProvider::class, #CUSTOM ELASTIC SESSION PROVIDER
],

add third party Package Facades:

'aliases' => [
    ...
    'Es' => Elasticquent\ElasticquentElasticsearchFacade::class,
],

run commands:

> composer dump-autoload -o
> composer update
> php artisan vendor:publish --force

The .env of DEFAULT DEVELOPMENT ENVIRONMENT:

SESSION_DRIVER=elastic

ELS_MAX_RESULT=20

ELS_SERVER=localhost
ELS_INDEX_USER=user
ELS_TYPE_SESSION=sessions

NB

edit the .env file with the right configuration parameters for the application you will develp i.e. all the ELS_* parameters, etc...

You need to set-up your own Index and Type for sessions and configure it in .env (ELS_INDEX_USER, ELS_TYPE_SESSION)

TODO

  1. TEST!!!!!!

Related Packages

bebbolus/elsquerybuildertrait

ElasticSearch Query Builder for Laravel PHP Framework

58 0
isswp101/elasticsearch-eloquent

Elasticsearch functionality like Laravel Eloquent models.

25,593 112
bebbolus/elsrepositorytrait

PHP trait to manage the Laravel Entity on ElasticSearch via Elastiquent

60 1
elasticquent/elasticquent

Maps Laravel Eloquent models to Elasticsearch types.

973,738 1,351
fadion/bouncy

Map Elasticsearch results to Eloquent models

16,545 71