10
10
[ ![ GitHub license] ( https://img.shields.io/badge/license-MIT-blue.svg )] ( https://raw.githubusercontent.com/GeneaLabs/laravel-model-caching/master/LICENSE )
11
11
12
12
## Impetus
13
- I created this package in response to a client project that had complex, nested
13
+ I created this package in response to a client project that had complex and nested
14
14
forms with many ` <select> ` 's that resulted in over 700 database queries on one
15
15
page. I needed a package that abstracted the caching process out of the model
16
16
for me, and one that would let me cache custom queries, as well as cache model
17
- relationships. This package is the attempt to address those requirements.
17
+ relationships. This package is an attempt to address those requirements.
18
18
19
19
## Features
20
20
- automatic, self-invalidating relationship (both eager- and lazy-loaded) caching.
@@ -36,7 +36,7 @@ composer require genealabs/laravel-model-caching
36
36
If you would like to use a different cache store than the default one used by
37
37
your Laravel application, you may do so by setting the ` MODEL_CACHE_STORE `
38
38
environment variable in your ` .env ` file to the name of a cache store configured
39
- in ` config/cache.php ` (you can define any custom cache store base on your
39
+ in ` config/cache.php ` (you can define any custom cache store based on your
40
40
specific needs there). For example:
41
41
```
42
42
MODEL_CACHE_STORE=redis
@@ -48,7 +48,7 @@ memcached). While this is optional, using a non-taggable cache provider will
48
48
mean that the entire cache is cleared each time a model is created, saved,
49
49
updated, or deleted.
50
50
51
- For ease of maintenance, I would recommend adding a ` BaseModel ` model that
51
+ For the ease of maintenance, I would recommend adding a ` BaseModel ` model that
52
52
extends ` CachedModel ` , from which all your other models are extended. If you
53
53
don't want to do that, simply extend your models directly from ` CachedModel ` .
54
54
@@ -66,7 +66,7 @@ abstract class BaseModel extends CachedModel
66
66
```
67
67
68
68
### Exception: User Model
69
- I would not recommend caching the user model, as it is a special case, since it
69
+ I would not recommend caching the user model, as it is a special case since it
70
70
extends ` Illuminate\Foundation\Auth\User ` . Overriding that would break functionality.
71
71
Not only that, but it probably isn't a good idea to cache the user model anyway,
72
72
since you always want to pull the most up-to-date info on it.
@@ -100,7 +100,7 @@ you should see somewhere around 100% performance increase.
100
100
101
101
## Commitment to Quality
102
102
During package development I try as best as possible to embrace good design and
103
- development practices to try to ensure that this package is as good as it can
103
+ development practices trying to ensure that this package is as good as it can
104
104
be. My checklist for package development includes:
105
105
106
106
- ✅ Achieve as close to 100% code coverage as possible using unit tests.
0 commit comments