@@ -68,7 +68,7 @@ public function testCacheIsNotEmptyAfterLoadingModels()
68
68
'genealabslaravelmodelcachingtestsfixturesauthor ' ,
69
69
'genealabslaravelmodelcachingtestsfixturesbook '
70
70
])
71
- ->get ('genealabslaravelmodelcachingtestsfixturesauthor-books ' );
71
+ ->get (sha1 ( 'genealabslaravelmodelcachingtestsfixturesauthor-books ' ) );
72
72
73
73
$ this ->assertNotNull ($ results );
74
74
}
@@ -83,7 +83,10 @@ public function testCreatingModelClearsCache()
83
83
'genealabslaravelmodelcachingtestsfixturesauthor ' ,
84
84
'genealabslaravelmodelcachingtestsfixturesbook '
85
85
])
86
- ->get ('genealabslaravelmodelcachingtestsfixturesauthor_1_2_3_4_5_6_7_8_9_10-genealabslaravelmodelcachingtestsfixturesbooks ' );
86
+ ->get (
87
+ 'genealabslaravelmodelcachingtestsfixturesauthor_1_2_3_4_5_6_ ' .
88
+ '7_8_9_10-genealabslaravelmodelcachingtestsfixturesbooks '
89
+ );
87
90
88
91
$ this ->assertNull ($ results );
89
92
}
@@ -98,7 +101,10 @@ public function testUpdatingModelClearsCache()
98
101
'genealabslaravelmodelcachingtestsfixturesauthor ' ,
99
102
'genealabslaravelmodelcachingtestsfixturesbook '
100
103
])
101
- ->get ('genealabslaravelmodelcachingtestsfixturesauthor_1_2_3_4_5_6_7_8_9_10-genealabslaravelmodelcachingtestsfixturesbooks ' );
104
+ ->get (
105
+ 'genealabslaravelmodelcachingtestsfixturesauthor_1_2_3_4_5_6_ ' .
106
+ '7_8_9_10-genealabslaravelmodelcachingtestsfixturesbooks '
107
+ );
102
108
103
109
$ this ->assertNull ($ results );
104
110
}
@@ -112,7 +118,10 @@ public function testDeletingModelClearsCache()
112
118
'genealabslaravelmodelcachingtestsfixturesauthor ' ,
113
119
'genealabslaravelmodelcachingtestsfixturesbook '
114
120
])
115
- ->get ('genealabslaravelmodelcachingtestsfixturesauthor_1_2_3_4_5_6_7_8_9_10-genealabslaravelmodelcachingtestsfixturesbooks ' );
121
+ ->get (
122
+ 'genealabslaravelmodelcachingtestsfixturesauthor_1_2_3_4_5_6_ ' .
123
+ '7_8_9_10-genealabslaravelmodelcachingtestsfixturesbooks '
124
+ );
116
125
117
126
$ this ->assertNull ($ results );
118
127
}
@@ -125,7 +134,7 @@ public function testHasManyRelationshipIsCached()
125
134
'genealabslaravelmodelcachingtestsfixturesauthor ' ,
126
135
'genealabslaravelmodelcachingtestsfixturesbook '
127
136
])
128
- ->get ("genealabslaravelmodelcachingtestsfixturesauthor-books " ));
137
+ ->get (sha1 ( "genealabslaravelmodelcachingtestsfixturesauthor-books " ) ));
129
138
130
139
$ this ->assertNotNull ($ results );
131
140
$ this ->assertEmpty ($ authors ->diffAssoc ($ results ));
@@ -142,7 +151,7 @@ public function testBelongsToRelationshipIsCached()
142
151
'genealabslaravelmodelcachingtestsfixturesbook ' ,
143
152
'genealabslaravelmodelcachingtestsfixturesauthor '
144
153
])
145
- ->get ("genealabslaravelmodelcachingtestsfixturesbook-author " ));
154
+ ->get (sha1 ( "genealabslaravelmodelcachingtestsfixturesbook-author " ) ));
146
155
147
156
$ this ->assertNotNull ($ results );
148
157
$ this ->assertEmpty ($ books ->diffAssoc ($ results ));
@@ -159,7 +168,7 @@ public function testBelongsToManyRelationshipIsCached()
159
168
'genealabslaravelmodelcachingtestsfixturesbook ' ,
160
169
'genealabslaravelmodelcachingtestsfixturesstore '
161
170
])
162
- ->get ("genealabslaravelmodelcachingtestsfixturesbook-stores " ));
171
+ ->get (sha1 ( "genealabslaravelmodelcachingtestsfixturesbook-stores " ) ));
163
172
164
173
$ this ->assertNotNull ($ results );
165
174
$ this ->assertEmpty ($ books ->diffAssoc ($ results ));
@@ -177,7 +186,7 @@ public function testHasOneRelationshipIsCached()
177
186
'genealabslaravelmodelcachingtestsfixturesauthor ' ,
178
187
'genealabslaravelmodelcachingtestsfixturesprofile '
179
188
])
180
- ->get ("genealabslaravelmodelcachingtestsfixturesauthor-profile " ));
189
+ ->get (sha1 ( "genealabslaravelmodelcachingtestsfixturesauthor-profile " ) ));
181
190
182
191
$ this ->assertNotNull ($ results );
183
192
$ this ->assertEmpty ($ authors ->diffAssoc ($ results ));
@@ -190,7 +199,7 @@ public function testAvgModelResultsCreatesCache()
190
199
{
191
200
$ authorId = (new Author )->with ('books ' , 'profile ' )
192
201
->avg ('id ' );
193
- $ key = 'genealabslaravelmodelcachingtestsfixturesauthor-books-profile-avg_id ' ;
202
+ $ key = sha1 ( 'genealabslaravelmodelcachingtestsfixturesauthor-books-profile-avg_id ' ) ;
194
203
$ tags = [
195
204
'genealabslaravelmodelcachingtestsfixturesauthor ' ,
196
205
'genealabslaravelmodelcachingtestsfixturesbook ' ,
@@ -230,7 +239,10 @@ public function testChunkModelResultsCreatesCache()
230
239
}
231
240
232
241
$ cachedChunks ['authors ' ]->push ($ chunk );
233
- $ cachedChunks ['keys ' ]->push ("genealabslaravelmodelcachingtestsfixturesauthor-books-profile_orderBy_authors.id_asc {$ offset }-limit_3 " );
242
+ $ cachedChunks ['keys ' ]->push (sha1 (
243
+ "genealabslaravelmodelcachingtestsfixturesauthor-books-pr " .
244
+ "ofile_orderBy_authors.id_asc {$ offset }-limit_3 "
245
+ ));
234
246
});
235
247
236
248
(new UncachedAuthor )->with ('books ' , 'profile ' )
@@ -253,7 +265,7 @@ public function testCountModelResultsCreatesCache()
253
265
$ authors = (new Author )
254
266
->with ('books ' , 'profile ' )
255
267
->count ();
256
- $ key = 'genealabslaravelmodelcachingtestsfixturesauthor-books-profile-count ' ;
268
+ $ key = sha1 ( 'genealabslaravelmodelcachingtestsfixturesauthor-books-profile-count ' ) ;
257
269
$ tags = [
258
270
'genealabslaravelmodelcachingtestsfixturesauthor ' ,
259
271
'genealabslaravelmodelcachingtestsfixturesbook ' ,
@@ -274,7 +286,7 @@ public function testCursorModelResultsCreatesCache()
274
286
$ authors = (new Author )
275
287
->with ('books ' , 'profile ' )
276
288
->cursor ();
277
- $ key = 'genealabslaravelmodelcachingtestsfixturesauthor-books-profile-cursor ' ;
289
+ $ key = sha1 ( 'genealabslaravelmodelcachingtestsfixturesauthor-books-profile-cursor ' ) ;
278
290
$ tags = [
279
291
'genealabslaravelmodelcachingtestsfixturesauthor ' ,
280
292
'genealabslaravelmodelcachingtestsfixturesbook ' ,
@@ -297,7 +309,7 @@ public function testCursorModelResultsCreatesCache()
297
309
public function testFindModelResultsCreatesCache ()
298
310
{
299
311
$ author = collect ()->push ((new Author )->find (1 ));
300
- $ key = 'genealabslaravelmodelcachingtestsfixturesauthor_1 ' ;
312
+ $ key = sha1 ( 'genealabslaravelmodelcachingtestsfixturesauthor_1 ' ) ;
301
313
$ tags = [
302
314
'genealabslaravelmodelcachingtestsfixturesauthor ' ,
303
315
];
@@ -314,7 +326,7 @@ public function testGetModelResultsCreatesCache()
314
326
{
315
327
$ authors = (new Author )->with ('books ' , 'profile ' )
316
328
->get ();
317
- $ key = 'genealabslaravelmodelcachingtestsfixturesauthor-books-profile ' ;
329
+ $ key = sha1 ( 'genealabslaravelmodelcachingtestsfixturesauthor-books-profile ' ) ;
318
330
$ tags = [
319
331
'genealabslaravelmodelcachingtestsfixturesauthor ' ,
320
332
'genealabslaravelmodelcachingtestsfixturesbook ' ,
@@ -334,7 +346,7 @@ public function testMaxModelResultsCreatesCache()
334
346
{
335
347
$ authorId = (new Author )->with ('books ' , 'profile ' )
336
348
->max ('id ' );
337
- $ key = 'genealabslaravelmodelcachingtestsfixturesauthor-books-profile-max_id ' ;
349
+ $ key = sha1 ( 'genealabslaravelmodelcachingtestsfixturesauthor-books-profile-max_id ' ) ;
338
350
$ tags = [
339
351
'genealabslaravelmodelcachingtestsfixturesauthor ' ,
340
352
'genealabslaravelmodelcachingtestsfixturesbook ' ,
@@ -354,7 +366,7 @@ public function testMinModelResultsCreatesCache()
354
366
{
355
367
$ authorId = (new Author )->with ('books ' , 'profile ' )
356
368
->min ('id ' );
357
- $ key = 'genealabslaravelmodelcachingtestsfixturesauthor-books-profile-min_id ' ;
369
+ $ key = sha1 ( 'genealabslaravelmodelcachingtestsfixturesauthor-books-profile-min_id ' ) ;
358
370
$ tags = [
359
371
'genealabslaravelmodelcachingtestsfixturesauthor ' ,
360
372
'genealabslaravelmodelcachingtestsfixturesbook ' ,
@@ -374,7 +386,7 @@ public function testPluckModelResultsCreatesCache()
374
386
{
375
387
$ authors = (new Author )->with ('books ' , 'profile ' )
376
388
->pluck ('name ' , 'id ' );
377
- $ key = 'genealabslaravelmodelcachingtestsfixturesauthor_name-books-profile-pluck_name_id ' ;
389
+ $ key = sha1 ( 'genealabslaravelmodelcachingtestsfixturesauthor_name-books-profile-pluck_name_id ' ) ;
378
390
$ tags = [
379
391
'genealabslaravelmodelcachingtestsfixturesauthor ' ,
380
392
'genealabslaravelmodelcachingtestsfixturesbook ' ,
@@ -394,7 +406,7 @@ public function testSumModelResultsCreatesCache()
394
406
{
395
407
$ authorId = (new Author )->with ('books ' , 'profile ' )
396
408
->sum ('id ' );
397
- $ key = 'genealabslaravelmodelcachingtestsfixturesauthor-books-profile-sum_id ' ;
409
+ $ key = sha1 ( 'genealabslaravelmodelcachingtestsfixturesauthor-books-profile-sum_id ' ) ;
398
410
$ tags = [
399
411
'genealabslaravelmodelcachingtestsfixturesauthor ' ,
400
412
'genealabslaravelmodelcachingtestsfixturesbook ' ,
@@ -414,7 +426,7 @@ public function testValueModelResultsCreatesCache()
414
426
{
415
427
$ authors = (new Author )->with ('books ' , 'profile ' )
416
428
->value ('name ' );
417
- $ key = 'genealabslaravelmodelcachingtestsfixturesauthor_name-books-profile-first ' ;
429
+ $ key = sha1 ( 'genealabslaravelmodelcachingtestsfixturesauthor_name-books-profile-first ' ) ;
418
430
$ tags = [
419
431
'genealabslaravelmodelcachingtestsfixturesauthor ' ,
420
432
'genealabslaravelmodelcachingtestsfixturesbook ' ,
@@ -437,7 +449,7 @@ public function testNestedRelationshipEagerLoading()
437
449
$ authors = collect ([(new Author )->with ('books.publisher ' )
438
450
->first ()]);
439
451
440
- $ key = 'genealabslaravelmodelcachingtestsfixturesauthor-books-books.publisher-first ' ;
452
+ $ key = sha1 ( 'genealabslaravelmodelcachingtestsfixturesauthor-books-books.publisher-first ' ) ;
441
453
$ tags = [
442
454
'genealabslaravelmodelcachingtestsfixturesauthor ' ,
443
455
'genealabslaravelmodelcachingtestsfixturesbook ' ,
@@ -456,7 +468,7 @@ public function testNestedRelationshipEagerLoading()
456
468
public function testLazyLoadedRelationshipResolvesThroughCachedBuilder ()
457
469
{
458
470
$ books = (new Author )->first ()->books ;
459
- $ key = 'genealabslaravelmodelcachingtestsfixturesbook-books.author_id_1-books.author_id_notnull ' ;
471
+ $ key = sha1 ( 'genealabslaravelmodelcachingtestsfixturesbook-books.author_id_1-books.author_id_notnull ' ) ;
460
472
$ tags = [
461
473
'genealabslaravelmodelcachingtestsfixturesbook ' ,
462
474
];
@@ -471,7 +483,7 @@ public function testLazyLoadedRelationshipResolvesThroughCachedBuilder()
471
483
public function testLazyLoadingOnResourceIsCached ()
472
484
{
473
485
$ books = (new AuthorResource ((new Author )->first ()))->books ;
474
- $ key = 'genealabslaravelmodelcachingtestsfixturesbook-books.author_id_1-books.author_id_notnull ' ;
486
+ $ key = sha1 ( 'genealabslaravelmodelcachingtestsfixturesbook-books.author_id_1-books.author_id_notnull ' ) ;
475
487
$ tags = [
476
488
'genealabslaravelmodelcachingtestsfixturesbook ' ,
477
489
];
@@ -487,7 +499,7 @@ public function testOrderByClauseParsing()
487
499
{
488
500
$ authors = (new Author )->orderBy ('name ' )->get ();
489
501
490
- $ key = 'genealabslaravelmodelcachingtestsfixturesauthor_orderBy_name_asc ' ;
502
+ $ key = sha1 ( 'genealabslaravelmodelcachingtestsfixturesauthor_orderBy_name_asc ' ) ;
491
503
$ tags = [
492
504
'genealabslaravelmodelcachingtestsfixturesauthor ' ,
493
505
];
@@ -504,7 +516,7 @@ public function testNestedRelationshipWhereClauseParsing()
504
516
$ authors = (new Author )->with ('books.publisher ' )
505
517
->get ();
506
518
507
- $ key = 'genealabslaravelmodelcachingtestsfixturesauthor-books-books.publisher ' ;
519
+ $ key = sha1 ( 'genealabslaravelmodelcachingtestsfixturesauthor-books-books.publisher ' ) ;
508
520
$ tags = [
509
521
'genealabslaravelmodelcachingtestsfixturesauthor ' ,
510
522
'genealabslaravelmodelcachingtestsfixturesbook ' ,
@@ -526,7 +538,7 @@ public function testExistsRelationshipWhereClauseParsing()
526
538
$ authors = (new Author )->whereHas ('books ' )
527
539
->get ();
528
540
529
- $ key = 'genealabslaravelmodelcachingtestsfixturesauthor_exists_and_authors.id_=_books.author_id ' ;
541
+ $ key = sha1 ( 'genealabslaravelmodelcachingtestsfixturesauthor_exists_and_authors.id_=_books.author_id ' ) ;
530
542
$ tags = ['genealabslaravelmodelcachingtestsfixturesauthor ' ];
531
543
532
544
$ cachedResults = cache ()->tags ($ tags )->get ($ key );
@@ -543,7 +555,7 @@ public function testDoesntHaveWhereClauseParsing()
543
555
->doesntHave ('books ' )
544
556
->get ();
545
557
546
- $ key = 'genealabslaravelmodelcachingtestsfixturesauthor_notexists_and_authors.id_=_books.author_id ' ;
558
+ $ key = sha1 ( 'genealabslaravelmodelcachingtestsfixturesauthor_notexists_and_authors.id_=_books.author_id ' ) ;
547
559
$ tags = ['genealabslaravelmodelcachingtestsfixturesauthor ' ];
548
560
549
561
$ cachedResults = cache ()
@@ -565,8 +577,8 @@ public function testColumnsRelationshipWhereClauseParsing()
565
577
$ authors = (new Author )
566
578
->where ('name ' , '= ' , $ author ->name )
567
579
->get ();
568
- $ key = 'genealabslaravelmodelcachingtestsfixturesauthor-name_ ' .
569
- $ author ->name ;
580
+ $ key = sha1 ( 'genealabslaravelmodelcachingtestsfixturesauthor-name_ ' .
581
+ $ author ->name ) ;
570
582
$ tags = ['genealabslaravelmodelcachingtestsfixturesauthor ' ];
571
583
572
584
$ cachedResults = cache ()
@@ -586,7 +598,7 @@ public function testRawWhereClauseParsing()
586
598
->whereRaw ('name <> \'\'' )
587
599
->first ()]);
588
600
589
- $ key = 'genealabslaravelmodelcachingtestsfixturesauthor_and_name-first ' ;
601
+ $ key = sha1 ( 'genealabslaravelmodelcachingtestsfixturesauthor_and_name-first ' ) ;
590
602
$ tags = ['genealabslaravelmodelcachingtestsfixturesauthor ' ];
591
603
592
604
$ cachedResults = collect ([cache ()->tags ($ tags )->get ($ key )]);
@@ -606,7 +618,7 @@ public function testScopeClauseParsing()
606
618
$ authors = (new Author )
607
619
->startsWithA ()
608
620
->get ();
609
- $ key = 'genealabslaravelmodelcachingtestsfixturesauthor-name_A% ' ;
621
+ $ key = sha1 ( 'genealabslaravelmodelcachingtestsfixturesauthor-name_A% ' ) ;
610
622
$ tags = ['genealabslaravelmodelcachingtestsfixturesauthor ' ];
611
623
612
624
$ cachedResults = cache ()->tags ($ tags )->get ($ key );
@@ -625,7 +637,7 @@ public function testRelationshipQueriesAreCached()
625
637
->first ()
626
638
->books ()
627
639
->get ();
628
- $ key = 'genealabslaravelmodelcachingtestsfixturesbook-books.author_id_1-books.author_id_notnull ' ;
640
+ $ key = sha1 ( 'genealabslaravelmodelcachingtestsfixturesbook-books.author_id_1-books.author_id_notnull ' ) ;
629
641
$ tags = [
630
642
'genealabslaravelmodelcachingtestsfixturesbook '
631
643
];
@@ -646,7 +658,7 @@ public function testRawOrderByWithoutColumnReference()
646
658
->orderByRaw ('DATE() ' )
647
659
->get ();
648
660
649
- $ key = 'genealabslaravelmodelcachingtestsfixturesauthor_orderByRaw_date ' ;
661
+ $ key = sha1 ( 'genealabslaravelmodelcachingtestsfixturesauthor_orderByRaw_date ' ) ;
650
662
$ tags = ['genealabslaravelmodelcachingtestsfixturesauthor ' ];
651
663
652
664
$ cachedResults = cache ()
@@ -669,7 +681,7 @@ public function testDelete()
669
681
->first ();
670
682
$ authorId = $ author ->id ;
671
683
$ liveResultId = $ liveResult ->id ;
672
- $ key = 'genealabslaravelmodelcachingtestsfixturesauthor ' ;
684
+ $ key = sha1 ( 'genealabslaravelmodelcachingtestsfixturesauthor ' ) ;
673
685
$ tags = ['genealabslaravelmodelcachingtestsfixturesauthor ' ];
674
686
675
687
$ author ->delete ();
0 commit comments