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

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

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

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

        return $return;
    }
public function getUserBySlug ( $ slug ) { $ return = array ( ) ; $ users = $ this -> repository -> users ; foreach ( $ users as $ user ) { if ( $ user -> slug == $ slug ) { $ return = $ user ; break ; } } return $ return ; }
Get user by slug

@param $slug

@return array
Get user by slug