BookStack\Repos\BookRepo::createFromInput PHP Method

createFromInput() public method

Get a new book instance from request input.
public createFromInput ( array $input ) : Book
$input array
return BookStack\Book
    public function createFromInput($input)
    {
        $book = $this->book->newInstance($input);
        $book->slug = $this->findSuitableSlug($book->name);
        $book->created_by = user()->id;
        $book->updated_by = user()->id;
        $book->save();
        $this->permissionService->buildJointPermissionsForEntity($book);
        return $book;
    }