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

Added Default Templates for Chapters

This commit is contained in:
Sascha
2024-01-01 21:58:49 +01:00
committed by GitHub
parent b191d8f99f
commit 70bfebcd7c
9 changed files with 131 additions and 9 deletions

View File

@ -49,9 +49,10 @@ class ChapterController extends Controller
public function store(Request $request, string $bookSlug)
{
$validated = $this->validate($request, [
'name' => ['required', 'string', 'max:255'],
'description_html' => ['string', 'max:2000'],
'tags' => ['array'],
'name' => ['required', 'string', 'max:255'],
'description_html' => ['string', 'max:2000'],
'tags' => ['array'],
'default_template_id' => ['nullable', 'integer'],
]);
$book = Book::visible()->where('slug', '=', $bookSlug)->firstOrFail();
@ -111,9 +112,10 @@ class ChapterController extends Controller
public function update(Request $request, string $bookSlug, string $chapterSlug)
{
$validated = $this->validate($request, [
'name' => ['required', 'string', 'max:255'],
'description_html' => ['string', 'max:2000'],
'tags' => ['array'],
'name' => ['required', 'string', 'max:255'],
'description_html' => ['string', 'max:2000'],
'tags' => ['array'],
'default_template_id' => ['nullable', 'integer'],
]);
$chapter = $this->chapterRepo->getBySlug($bookSlug, $chapterSlug);