You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remember your query results using only one method. Yes, only one.
10
10
@@ -20,7 +20,8 @@ Your support allows me to keep this package free, up-to-date and maintainable. A
20
20
21
21
## Requirements
22
22
23
-
* Laravel 11 or later
23
+
* PHP 8.3
24
+
* Laravel 12 or later
24
25
25
26
## Installation
26
27
@@ -30,15 +31,15 @@ You can install the package via composer:
30
31
composer require laragear/cache-query
31
32
```
32
33
33
-
## How it works?
34
+
## How does it work?
34
35
35
-
This library wraps the connection into a proxy object. It proxies all method calls to it except `select()` and `selectOne()`.
36
+
This library wraps the database connection into a proxy object. It proxies all method calls to it except `select()` and `selectOne()`.
36
37
37
38
Once a `SELECT` statement is executed through the aforementioned methods, it will check if the results are in the cache before executing the query. On cache hit, it will return the cached results, otherwise it will continue execution, save the results using the cache configuration, and return them.
38
39
39
40
## Usage
40
41
41
-
Just use the `cache()` method to remember the results of a query for a default of 60 seconds.
42
+
Use the `cache()` method to remember the results of a query for a default of 60 seconds.
The next time you call the **same** query, the result will be retrieved from the cache instead of running the `SELECT` SQL statement in the database, even if the results are empty, `null` or `false`. You may also desire to [not cache empty results](#cache-except-empty-results).
53
54
54
-
It's **eager load aware**. This means that it will cache an eager loaded relation automatically, but [you may also disable this](#eager-loaded-queries).
55
+
It's **eager load aware**. This means that it will cache an eager loaded relation automatically (but [you may also disable this](#eager-loaded-queries)).
0 commit comments