We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 62c4baf + db3046d commit d003028Copy full SHA for d003028
tests/Integration/CachedModelTest.php
@@ -98,6 +98,26 @@ public function testWhereHasIsBeingCached()
98
$this->assertEquals(1, $cachedResults->first()->author->id);
99
}
100
101
+ public function testWhereHasWithClosureIsBeingCached()
102
+ {
103
+ $books1 = (new Book)
104
+ ->with('author')
105
+ ->whereHas('author', function ($query) {
106
+ $query->whereId(1);
107
+ })
108
+ ->get()
109
+ ->keyBy('id');
110
+ $books2 = (new Book)
111
112
113
+ $query->whereId(2);
114
115
116
117
+
118
+ $this->assertNotEmpty($books1->diffKeys($books2));
119
+ }
120
121
public function testModelCacheDoesntInvalidateDuringCooldownPeriod()
122
{
123
$authors = (new Author)
0 commit comments