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

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