Skip to content

Commit 3d91b07

Browse files
committed
Merge pull request #1 from mhh1422/master
First version
2 parents fd4cac9 + 4ac7ecd commit 3d91b07

File tree

7 files changed

+3288
-6
lines changed

7 files changed

+3288
-6
lines changed

.gitignore

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/bootstrap/compiled.php
2-
.env.*.php
3-
.env.php
4-
.env
1+
/nbproject/
2+
/vendor/
3+
/tests/

README.md

Lines changed: 60 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,60 @@
1-
# laravel-elastic-sessions
2-
A session driver for elastic search for laravel 5.1
1+
# Laravel Elastic Session Driver
2+
An elastic-search based session driver for Laravel 5.1
3+
4+
##How to use
5+
1. Require it via composer
6+
7+
```
8+
composer require itvisionsy/laravel-elastic-sessions
9+
```
10+
2. Add it to the providers list in `config/app.php`:
11+
12+
```php
13+
'providers' => [
14+
//...
15+
ItvisionSy\LaravelElasticSessionDriver\ElasticSessionServiceProvider::class,
16+
//...
17+
]
18+
```
19+
3. Set the correct settings in `config/session.php`
20+
21+
```php
22+
"driver" => "elastic",
23+
"elastic" => [
24+
"url" => "http://localhost:9200/",
25+
"index" => "laravel-es-sessions",
26+
"type" => "session"
27+
],
28+
```
29+
Values shown above are the default values in case you did not configure.
30+
31+
##Index/Type mapping
32+
Elastic will detect the mapping by default, however, it is recommended to set the mapping explicitly.
33+
34+
You can do so manually by applying this mapping to the index and type:
35+
36+
```json
37+
{
38+
"index":"set_the_index",
39+
"type":"set_the_type",
40+
"body":{
41+
"properties":{
42+
"created":{"type":"date"},
43+
"updated":{"type":"date"},
44+
"data":{"type":"string","index":"no"}
45+
}
46+
}
47+
}
48+
```
49+
50+
Or simpler, the package can do it for you. You will need to tinker `./artisan tinker` and then set the mapping:
51+
52+
```php
53+
\ItvisionSy\LaravelElasticSessionDriver\ElasticSessionStore::putMapping();
54+
```
55+
56+
## Author
57+
Muhannad Shelleh <[email protected]>
58+
59+
## License
60+
This code is published under [MIT](LICENSE) license.

composer.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "itvisionsy/laravel-elastic-session",
3+
"description": "A laravel 5.1 session driver on elasticsearch",
4+
"require": {
5+
"php": ">=5.5.0",
6+
"laravel/laravel": "5.1.*",
7+
"itvisionsy/php-es-orm": "1.4.*"
8+
},
9+
"require-dev": {
10+
"phpunit/phpunit": "^5.0@dev"
11+
},
12+
"license": "MIT",
13+
"authors": [
14+
{
15+
"name": "Muhannad Shelleh",
16+
"email": "[email protected]"
17+
}
18+
],
19+
"minimum-stability": "stable",
20+
"autoload": {
21+
"psr-4": {
22+
"ItvisionSy\\LaravelElasticSessionDriver\\": "src"
23+
}
24+
}
25+
}

0 commit comments

Comments
 (0)