Get user by slug

@param $slug

@return array
176870
public function getUserBySlug($slug)
    {
        $return = array();

        $users = $this->repository->users;
        foreach ($users as $user) {
            if ($user->slug == $slug) {
                $return = $user;
                break;
            }
        }

        return $return;
    }
772679
public function findOneBySlug($slug)
    {
        return $this->_em->createQueryBuilder()
            ->select('p, t, c, co')
            ->from('VeonikBlogBundle:AbstractPost', 'p')
            ->leftJoin('p.tags', 't')
            ->leftJoin('p.categories', 'c')
            ->leftJoin('p.comments', 'co')
            ->where('p.slug = :slug')
            ->andWhere('p.active = true')
            ->setParameter('slug', $slug)
            ->getQuery()
            ->getOneOrNullResult();
    }
819907
public function getLogCollection($slug)
    {
        foreach ($this->logCollections as $logCollection) {
            if ($logCollection->getSlug() == $slug) {
                return $logCollection;
            }
        }
    }
933922
public function getBySlug($lang, $slug)
    {
        $postType = PostType::collection()->where('slug', $slug);
        if(!$postType->isEmpty()) {
            return $postType->first();
        }
        return [];
    }
1203507
public function findBySlug($slug)
    {
        return $this->model
            ->whereSlug($slug)
            ->with($this->with)
            ->first();
    }
1049338
private function getExistingSlugs($slug)
    {
        $list = collect();
        foreach ($this->uniqueModels() as $class) {

            // get entries matching slug
            $slugs = $this->eloqent($class)
                ->whereRaw("slug LIKE '$slug%'")
                ->withTrashed()// trashed, when entry gets activated
                ->get()
                ->pluck('slug');

            $list = $list->merge($slugs);
        }

        return $list;
    }
126764
public static function getISOBySlug($slug)
    {
        $data = collect(self::ISOlist());
        return $data->where('slug', $slug)->first();
    }
996617
public function may($slug)
    {
        return ! $this->permissions->filter(function (PermissionContract $permission) use ($slug) {
            return $permission->hasSlug($slug);
        })->isEmpty();
    }
798768
def _get_user(session, slug_or_user_id):
        
        user_json_items = session.fetch('users.get', user_ids=slug_or_user_id, fields=User.USER_FIELDS)
        return User.from_json(session, user_json_items[0])
411830
public function find($slug, array $columns = ['*'])
    {
        $model = $this->model;

        return $model::where('slug', '=', $slug)->first($columns);
    }
1023708
public function get_post_type_by_slug( $slug ) {
		if ( ! isset( $this->_custom_posts_mapper[ $slug ] ) ) {
			return null;
		}

		return $this->get_custom_post_type( $this->_custom_posts_mapper[ $slug ] );
	}
746385
public function getLog($slug)
    {
        foreach ($this->logs as $log) {
            if ($log->getSlug() == $slug) {
                return $log;
            }
        }
    }
1124757
public function revokeRoleBySlug($slug)
    {
        $role = Role::where('slug', $slug)->first();

        return $this->roles()->detach($role);
    }
233641
public function getRedirectBySlug($slug)
    {
        $redirects = $this->repository->redirects;
        foreach ($redirects as $redirect) {
            if ($redirect->slug == $slug) {
                return $redirect;
            }
        }

        return null;
    }
873225
public function request($slug, $params = []) {
		$headers = array(
			'Accept' => 'application/json',
			'Accept-Encoding' =>'gzip, deflate'
			);
		$uri = $this->uriConstruct($slug, $params);
		$response = Requests::get($uri , $headers, $this->options);

		return $response->body;
	}
984446
public function getEntityObject($slug = null)
    {
        if (! is_null($this->entity)) {
            return $this->entity;
        }

        return $this->getEntity($slug ?? $this->getAttribute('type'))->entity;
    }
1081335
public function getBrickBySlug($slug)
    {
        $bricks = $this->repository->bricks;
        foreach ($bricks as $brick) {
            if ($brick->slug == $slug) {
                return $brick;
            }
        }

        return null;
    }