1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Refactored some core entity actions

- Created BookChild class to share some page/chapter logic.
- Gave entities the power to generate their own permissions and slugs.
- Moved bits out of BaseController constructor since it was overly
sticky.
- Moved slug generation logic into its own class.
- Created a facade for permissions due to high use.
- Fixed failing test issues from last commits
This commit is contained in:
Dan Brown
2019-09-20 00:18:28 +01:00
parent f7a5a0705b
commit 8b550991a4
25 changed files with 242 additions and 187 deletions

View File

@ -201,7 +201,9 @@ class ChapterController extends Controller
return redirect()->back();
}
$this->entityRepo->changeBook('chapter', $parent->id, $chapter, true);
$this->entityRepo->changeBook($chapter, $parent->id);
$chapter->rebuildPermissions();
Activity::add($chapter, 'chapter_move', $chapter->book->id);
$this->showSuccessNotification( trans('entities.chapter_move_success', ['bookName' => $parent->name]));