File tree Expand file tree Collapse file tree 4 files changed +12
-16
lines changed
Integration/CachedBuilder Expand file tree Collapse file tree 4 files changed +12
-16
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ public function make(
3939 $ key .= $ this ->getOffsetClause ();
4040 $ key .= $ this ->getLimitClause ();
4141 $ key .= $ keyDifferentiator ;
42- dump ( " key " , $ key );
42+
4343 return $ key ;
4444 }
4545
Original file line number Diff line number Diff line change @@ -37,9 +37,10 @@ public static function bootCachable()
3737 $ instance ->checkCooldownAndFlushAfterPersiting ($ instance );
3838 });
3939
40- static ::restored (function ($ instance ) {
41- $ instance ->checkCooldownAndFlushAfterPersiting ($ instance );
42- });
40+ // TODO: figure out how to add this listener
41+ // static::restored(function ($instance) {
42+ // $instance->checkCooldownAndFlushAfterPersiting($instance);
43+ // });
4344
4445 static ::pivotAttached (function ($ instance ) {
4546 $ instance ->checkCooldownAndFlushAfterPersiting ($ instance );
Original file line number Diff line number Diff line change @@ -42,21 +42,16 @@ public function testWithCountUpdatesAfterRecordIsAdded()
4242 $ this ->assertEquals ($ author1 ->books_count + 1 , $ author2 ->books_count );
4343 }
4444
45- /** @group test */
4645 public function testWithCountOnMorphManyRelationshipUpdatesAfterRecordIsAdded ()
4746 {
4847 $ book1 = (new Book )
4948 ->withCount ("comments " )
5049 ->first ();
51- dump ("start " );
52- factory (Comment::class, 1 )
53- ->make ()
54- ->each (function ($ comment ) use ($ book1 ) {
55- $ comment ->commentable_id = $ book1 ->id ;
56- $ comment ->commentable_type = $ book1 ->getTable ();
57- $ comment ->save ();
58- });
59- dump ("end " );
50+ $ comment = factory (Comment::class, 1 )
51+ ->create ()
52+ ->first ();
53+
54+ $ book1 ->comments ()->save ($ comment );
6055
6156 $ book2 = (new Book )
6257 ->withCount ("comments " )
Original file line number Diff line number Diff line change @@ -11,8 +11,8 @@ public function up()
1111 $ table ->increments ('id ' );
1212 $ table ->timestamps ();
1313
14- $ table ->unsignedInteger ("commentable_id " );
15- $ table ->string ("commentable_type " );
14+ $ table ->unsignedInteger ("commentable_id " )-> nullable () ;
15+ $ table ->string ("commentable_type " )-> nullable () ;
1616 $ table ->text ("description " );
1717 $ table ->string ("subject " );
1818 });
You can’t perform that action at this time.
0 commit comments