$shelf = new Bookshelf();
$this->baseRepo->create($shelf, $input);
$this->updateBooks($shelf, $bookIds);
- Activity::addForEntity($shelf, ActivityType::BOOKSHELF_CREATE);
+ Activity::add(ActivityType::BOOKSHELF_CREATE, $shelf);
return $shelf;
}
$this->updateBooks($shelf, $bookIds);
}
- Activity::addForEntity($shelf, ActivityType::BOOKSHELF_UPDATE);
+ Activity::add(ActivityType::BOOKSHELF_UPDATE, $shelf);
return $shelf;
}
$syncData = Book::visible()
->whereIn('id', $bookIds)
- ->get(['id'])->pluck('id')->mapWithKeys(function ($bookId) use ($numericIDs) {
+ ->pluck('id')
+ ->mapWithKeys(function ($bookId) use ($numericIDs) {
return [$bookId => ['order' => $numericIDs->search($bookId)]];
});
{
$trashCan = new TrashCan();
$trashCan->softDestroyShelf($shelf);
- Activity::addForEntity($shelf, ActivityType::BOOKSHELF_DELETE);
+ Activity::add(ActivityType::BOOKSHELF_DELETE, $shelf);
$trashCan->autoClearOld();
}
}