use method touch in CategoryObserver

This commit is contained in:
MonaHartdegen 2019-12-10 08:43:45 +01:00
parent 8f010045e7
commit 1d9892699d
1 changed files with 2 additions and 6 deletions

View File

@ -27,11 +27,7 @@ class CategoryObserver
public function saved($category) public function saved($category)
{ {
foreach ($category->children as $child) { foreach ($category->children as $child) {
// Hacky trick to make this method unit-testable (instead of $child->touch() $child->touch();
// as the unit test is too fast)
$child->setUpdatedAt(Carbon::now()->addSecond());
$child->save();
} }
} }
} }