BookStack\Repos\BookRepo::doesSlugExist PHP Method

doesSlugExist() public method

public doesSlugExist ( string $slug, boolean | false $currentId = false ) : boolean
$slug string
$currentId boolean | false
return boolean
    public function doesSlugExist($slug, $currentId = false)
    {
        $query = $this->book->where('slug', '=', $slug);
        if ($currentId) {
            $query = $query->where('id', '!=', $currentId);
        }
        return $query->count() > 0;
    }