Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

omrakhurs's avatar

Trying to connect to SharePoint via Thybag/PHP-Sharepoint-Lists-API

Could someone please explain the following code, which connects a PHP app to a SharePoint account to access documents on that Sharepoint account. I know that it's not done this way in Laravel, so if someone could also tell if there would be some issues if it is used in Laravel?

    public function get_sharepoint_documents()
    {
        
        $listName = 'Knowledge Base Documents';
    
        if(!$cache_data = $this->cache->get('cache_sharepoint'))
        {
            $sp = new SharePointAPI('[email protected]', 'password', '\resources\Lists.asmx.xml','SPONLINE');
            $listContents = $sp->read($listName, NULL, NULL);
            $this->cache->save('cache_sharepoint',$listContents, 86400);
            $cache_data = $listContents;
        }
        //return $listContents;
        return $cache_data;
    }
0 likes
4 replies
seandelaney's avatar

Did you make any progress connecting to Sharepoint?

I'm also trying to connect Laravel to Sharepoint but having similar issues.

Sinnbeck's avatar

@Jedguy why not make your own thread with your own problem instead of digging up old threads :)

Please or to participate in this conversation.