diff --git a/src/TagRepository.php b/src/TagRepository.php index d2b0cbaf..184081ce 100644 --- a/src/TagRepository.php +++ b/src/TagRepository.php @@ -63,11 +63,11 @@ public function all(User $user = null) * @param User|null $user * @return int */ - public function getIdForSlug($slug, User $user = null) + public function getIdForSlug($slug, User $user = null) : ?int { - $query = Tag::where('slug', 'like', $slug); + $query = Tag::where('slug', $slug); - return $this->scopeVisibleTo($query, $user)->pluck('id'); + return $this->scopeVisibleTo($query, $user)->value('id'); } /**