BookStack\Repos\BookRepo::updateFromInput PHP Method

updateFromInput() public method

Update the given book from user input.
public updateFromInput ( Book $book, $input ) : Book
$book BookStack\Book
$input
return BookStack\Book
    public function updateFromInput(Book $book, $input)
    {
        if ($book->name !== $input['name']) {
            $book->slug = $this->findSuitableSlug($input['name'], $book->id);
        }
        $book->fill($input);
        $book->updated_by = user()->id;
        $book->save();
        $this->permissionService->buildJointPermissionsForEntity($book);
        return $book;
    }