src/TagRepository.php
public function all(User $user = null)
    {
        $query = Tag::query();

        return $this->scopeVisibleTo($query, $user)->get();
    }
public function all(User $user = null)
    {
        $query = Tag::query();

        return $this->scopeVisibleTo($query, $user)->get();
    }
public function all ( User $ user = null ) { $ query = Tag :: query ( ) ; return $ this -> scopeVisibleTo ( $ query , $ user ) -> get ( ) ; }
Find all tags, optionally making sure they are visible to a
certain user.

@param User|null $user
@return \Illuminate\Database\Eloquent\Collection
Find all tags optionally making sure they are visible to a certain user .