Skip to content

Commit 3dd4b42

Browse files
committed
Update documentation
1 parent e88b617 commit 3dd4b42

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## [0.2.48] - 9 Mar 2018
8+
### Added
9+
- database connection name to cache prefix.
10+
11+
## [0.2.47] - 5 Mar 2018
12+
### Fixed
13+
- exception when calling disableCache() when caching is already disabled via config.
14+
15+
## [0.2.46] - 5 Mar 2018
16+
### Fixed
17+
- package dependency version to work with Laravel 5.5.
18+
719
## [0.2.45] - 3 Mar 2018
820
### Fixed
921
- pagination cache key generation; fixes #85.

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@ abstract class BaseModel
6767
//
6868
}
6969
```
70+
### Multiple Database Connections
71+
__Thanks to @dtvmedia for suggestion this feature. This is actually a more robust
72+
solution than cache-prefixes.__
73+
74+
Keeping keys separate for multiple database connections is automatically handled.
75+
This is especially important for multi-tenant applications, and of course any
76+
application using multiple database connections.
7077

7178
### Optional Cache Key Prefix
7279
Thanks to @lucian-dragomir for suggesting this feature! You can use cache key
@@ -75,7 +82,8 @@ it is recommended to add the Cachable trait to a base model, then set the cache
7582
key prefix config value there.
7683

7784
**Note that the config setting is included before the parent method is called,
78-
so that the setting is available in the parent as well.**
85+
so that the setting is available in the parent as well. If you are developing a
86+
multi-tenant application, see the note above.**
7987

8088
Here's is an example:
8189
```php
@@ -92,7 +100,7 @@ class BaseModel extends Model
92100

93101
public function __construct($attributes = [])
94102
{
95-
config(['genealabs:laravel-model-caching' => 'test-prefix']);
103+
config(['laravel-model-caching.cache-prefix' => 'test-prefix']);
96104

97105
parent::__construct($attributes);
98106
}

0 commit comments

Comments
 (0)