original_string: public function scopeAuthenticated(Builder $query, $authenticated)
      {
          return $query->when(!$authenticated, function (Builder $query) {
              return $query->whereDoesntHave('group', function (Builder $query) {
                  $query->where('visible', ComponentGroup::VISIBLE_AUTHENTICATED);
              });
          });
      }
code: public function scopeAuthenticated(Builder $query, $authenticated)
      {
          return $query->when(!$authenticated, function (Builder $query) {
              return $query->whereDoesntHave('group', function (Builder $query) {
                  $query->where('visible', ComponentGroup::VISIBLE_AUTHENTICATED);
              });
          });
      }
code_tokens: public function scopeAuthenticated ( Builder $ query , $ authenticated ) { return $ query -> when ( ! $ authenticated , function ( Builder $ query ) { return $ query -> whereDoesntHave ( 'group' , function ( Builder $ query ) { $ query -> where ( 'visible' , ComponentGroup :: VISIBLE_AUTHENTICATED ) ; } ) ; } ) ; }
docstring: Find all components which are within visible groups.
  
  @param \Illuminate\Database\Eloquent\Builder $query
  @param bool                                  $authenticated
  
  @return \Illuminate\Database\Eloquent\Builder
docstring_tokens: Find all components which are within visible groups .