Skip to content

Commit 26daa71

Browse files
committed
Fix edge-case where tag creation failed
Fixes #154 Fixes #163
1 parent e3218cd commit 26daa71

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ 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.3.1] - 10 Sep 2018
7+
## [0.3.1] - 7 Oct 2018
88
### Changed
99
- use of `cache()` helper method to `app("cache")` to allow for better Lumen compatibility. Thanks @nope7777!
1010

@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1616

1717
### Fixed
1818
- use of custom pagination name.
19+
- edge-case where tag creation failed.
1920

2021
## [0.3.0] - 10 Sep 2018
2122
### Added

src/Traits/Caching.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,12 @@ protected function makeCacheKey(
7979
protected function makeCacheTags() : array
8080
{
8181
$eagerLoad = $this->eagerLoad ?? [];
82-
$model = $this->model ?? $this;
83-
$query = $this->query ?? app('db')->query();
84-
82+
$model = $this->model instanceof Model
83+
? $this->model
84+
: $this;
85+
$query = $this->query instanceof Builder
86+
? $this->query
87+
: app('db')->query();
8588
$tags = (new CacheTags($eagerLoad, $model, $query))
8689
->make();
8790

0 commit comments

Comments
 (0)