}
// Book
- $bookMatch = preg_match('/\/books\/(.+?)\/([\/?#\s$]|$)/i', $link, $matches);
+ $bookMatch = preg_match('/\/books\/(.+?)([\/?#\s$]|$)/i', $link, $matches);
if ($bookMatch) {
return Book::query()->where('slug', '=', $matches[1])->exists();
}
// Shelf
- $shelfMatch = preg_match('/\/shelves\/(.*?)\/([\/?#\s$]|$)/i', $link, $matches);
+ $shelfMatch = preg_match('/\/shelves\/(.*?)([\/?#\s$]|$)/i', $link, $matches);
if ($shelfMatch) {
return Bookshelf::query()->where('slug', '=', $matches[1])->exists();
}