예제 #1
0
 /**
  * Find all tags, optionally making sure they are visible to a
  * certain user.
  *
  * @param User|null $user
  * @return \Illuminate\Database\Eloquent\Collection
  */
 public function all(User $user = null)
 {
     $query = Tag::newQuery();
     return $this->scopeVisibleTo($query, $user)->get();
 }