BookStack\Repos\ChapterRepo::createFromInput PHP Метод

createFromInput() публичный Метод

Create a new chapter from request input.
public createFromInput ( $input, Book $book ) : Chapter
$input
$book BookStack\Book
Результат BookStack\Chapter
    public function createFromInput($input, Book $book)
    {
        $chapter = $this->chapter->newInstance($input);
        $chapter->slug = $this->findSuitableSlug($chapter->name, $book->id);
        $chapter->created_by = user()->id;
        $chapter->updated_by = user()->id;
        $chapter = $book->chapters()->save($chapter);
        $this->permissionService->buildJointPermissionsForEntity($chapter);
        return $chapter;
    }